@enyxs/wikex-components 0.10.0 → 0.11.1

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/README.md CHANGED
@@ -61,3 +61,26 @@ npm run build
61
61
  git tag v0.8.1
62
62
  git push origin main --tags
63
63
  ```
64
+
65
+
66
+ ### Editable fees and margin table
67
+
68
+ `commodity-fees` supports editing every data cell and column title in CMS preview,
69
+ adding/removing rows and columns with confirmation dialogs, and selecting multiple tags per row with MUI Select.
70
+ Search ignores Vietnamese accents and searches commodity names/codes. Tag and
71
+ search filters are combined before pagination (10 rows per page). Adding a row
72
+ clears filters and opens its page. Deleting all rows keeps the table empty.
73
+
74
+ CMS stores the table as JSON strings in `vi.feesTable` and `en.feesTable`, so the
75
+ existing page save/publish flow persists it without separate database tables.
76
+ Old pages retain their original sample table until edited. Visitors only get
77
+ search, tag filters and pagination, with no editing controls.
78
+
79
+ For another app, import `FeesTable` and `FeesTableData` from
80
+ `@enyxs/wikex-components`. Pass controlled `value`, `onChange`, and `editable`.
81
+ The component supplies its table theme; provide the package's existing icon
82
+ assets for pagination, as with other Wikex components. Run `npm run test:fees`
83
+ for data/search/pagination regression checks.
84
+
85
+ Create tags from the toolbar dialog; unassigned tags persist in the table catalog.
86
+ Editor textareas automatically fit their text. Header actions share an aligned row.
package/dist/index.d.mts CHANGED
@@ -76,6 +76,36 @@ declare const siteChromeBlocks: CmsBlock[];
76
76
 
77
77
  declare const wikexCommodityBlocks: CmsBlock[];
78
78
 
79
+ type FeesTableColumn = {
80
+ key: string;
81
+ title: string;
82
+ };
83
+ type FeesTableRow = {
84
+ id: string;
85
+ cells: Record<string, string>;
86
+ tags: string[];
87
+ };
88
+ type FeesTableData = {
89
+ columns: FeesTableColumn[];
90
+ rows: FeesTableRow[];
91
+ tags?: string[];
92
+ };
93
+
94
+ type FeesTableProps = {
95
+ value: FeesTableData;
96
+ editable?: boolean;
97
+ onChange?: (value: FeesTableData) => void;
98
+ labels?: {
99
+ search?: string;
100
+ all?: string;
101
+ empty?: string;
102
+ };
103
+ size?: 'sm' | 'md';
104
+ tagOrder?: string[];
105
+ };
106
+ /** Uses the original Wikex table, tabs, search and pagination styles. */
107
+ declare function FeesTable({ value, editable, onChange, labels, size, tagOrder }: FeesTableProps): react.JSX.Element;
108
+
79
109
  declare const minimalUiComponents: CmsBlock[];
80
110
  declare const wikexComponents: CmsBlock[];
81
111
  declare const wikexCmsBlocks: {
@@ -90,4 +120,4 @@ declare const wikexCmsBlocks: {
90
120
  definition: CmsComponentDefinition;
91
121
  }[];
92
122
 
93
- export { type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsTextTarget, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
123
+ export { type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsTextTarget, FeesTable, type FeesTableColumn, type FeesTableData, type FeesTableProps, type FeesTableRow, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
package/dist/index.d.ts CHANGED
@@ -76,6 +76,36 @@ declare const siteChromeBlocks: CmsBlock[];
76
76
 
77
77
  declare const wikexCommodityBlocks: CmsBlock[];
78
78
 
79
+ type FeesTableColumn = {
80
+ key: string;
81
+ title: string;
82
+ };
83
+ type FeesTableRow = {
84
+ id: string;
85
+ cells: Record<string, string>;
86
+ tags: string[];
87
+ };
88
+ type FeesTableData = {
89
+ columns: FeesTableColumn[];
90
+ rows: FeesTableRow[];
91
+ tags?: string[];
92
+ };
93
+
94
+ type FeesTableProps = {
95
+ value: FeesTableData;
96
+ editable?: boolean;
97
+ onChange?: (value: FeesTableData) => void;
98
+ labels?: {
99
+ search?: string;
100
+ all?: string;
101
+ empty?: string;
102
+ };
103
+ size?: 'sm' | 'md';
104
+ tagOrder?: string[];
105
+ };
106
+ /** Uses the original Wikex table, tabs, search and pagination styles. */
107
+ declare function FeesTable({ value, editable, onChange, labels, size, tagOrder }: FeesTableProps): react.JSX.Element;
108
+
79
109
  declare const minimalUiComponents: CmsBlock[];
80
110
  declare const wikexComponents: CmsBlock[];
81
111
  declare const wikexCmsBlocks: {
@@ -90,4 +120,4 @@ declare const wikexCmsBlocks: {
90
120
  definition: CmsComponentDefinition;
91
121
  }[];
92
122
 
93
- export { type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsTextTarget, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
123
+ export { type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsTextTarget, FeesTable, type FeesTableColumn, type FeesTableData, type FeesTableProps, type FeesTableRow, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };