@economic/taco 2.26.2 → 2.26.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +4 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/{useStylesheet.js → useTableStyle.js} +24 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/{useStylesheetColumnFreezing.js → useTableStyleColumnFreezing.js} +6 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/{useStylesheetColumnFreezing.js.map → useTableStyleColumnFreezing.js.map} +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/{useStylesheetCssGrid.js → useTableStyleGrid.js} +12 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +6 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +2 -22
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/primitives/Table/Core/features/useTableStyle.d.ts +797 -0
- package/dist/primitives/Table/Core/features/useTableStyleColumnFreezing.d.ts +4 -0
- package/dist/primitives/Table/Core/features/useTableStyleGrid.d.ts +7 -0
- package/dist/primitives/Table/Core/useTable.d.ts +2 -1
- package/dist/primitives/Table/useTableManager/util/presets.d.ts +1 -1
- package/dist/taco.cjs.development.js +47 -41
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useStylesheet.js.map +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useStylesheetCssGrid.js.map +0 -1
- package/dist/primitives/Table/Core/features/useStylesheet.d.ts +0 -3
- package/dist/primitives/Table/Core/features/useStylesheetColumnFreezing.d.ts +0 -2
- package/dist/primitives/Table/Core/features/useStylesheetCssGrid.d.ts +0 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/presets.ts"],"sourcesContent":["import React from 'react';\nimport { TableFeatureProps, TablePreset, TableProps } from '../../types';\n\nconst DEFAULT_PRESET: TableFeatureProps = {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: false,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: false,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: false,\n};\n\nconst presets: Record<TablePreset, TableFeatureProps> = {\n // View/edit/create on page\n complex: {\n // react-table built-in\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnResizing: true,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: true,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableSaveSettings: true,\n },\n // View/create in dialog\n list: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n // View in card or dialog\n simple: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: false,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n};\n\nexport function useTableFeaturePreset<TType = unknown>(props: TableProps<TType>): TableFeatureProps {\n const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;\n\n const enableRowActions = props.enableRowActions ?? presetOptions.enableRowActions;\n const enableRowClick = props.enableRowClick ?? presetOptions.enableRowClick;\n const enableRowDrag = props.enableRowDrag ?? presetOptions.enableRowDrag;\n const enableRowDrop = props.enableRowDrop ?? presetOptions.enableRowDrop;\n const enableRowGoto = props.enableRowGoto ?? presetOptions.enableRowGoto;\n const enableRowExpansion = props.enableRowExpansion ?? presetOptions.enableRowExpansion;\n const enableRowSelection = props.enableRowSelection ?? presetOptions.enableRowSelection;\n const enableRowSelectionSingle = props.enableRowSelectionSingle ?? presetOptions.enableRowSelectionSingle;\n\n // guard options that might be unintentionally broken\n React.useEffect(() => {\n if (enableRowClick && !props.onRowClick) {\n console.warn(\n `Table (id: ${props.id}) - Row click is enabled but no \\`onRowClick\\` handler has been provided. Provide one to enable row click or set \\`enableRowClick\\` to \\`false\\`.`\n );\n }\n\n if (enableRowGoto && !props.onRowGoto) {\n console.warn(\n `Table (id: ${props.id}) - Row click is enabled but no \\`onRowGoto\\` handler has been provided. Provide one to enable row goto or set \\`enableRowGoto\\` to \\`false\\`.`\n );\n }\n\n if (enableRowExpansion && !props.rowExpansionRenderer) {\n console.warn(\n `Table (id: ${props.id}) - Row expansion is enabled but no \\`rowExpansionRenderer\\` has been provided. Provide one to enable row expansion or set \\`enableRowExpansion\\` to \\`false\\`.`\n );\n }\n\n if (enableRowSelection && !props.onRowSelect) {\n console.warn(\n `Table (id: ${props.id}) - Row selection is enabled but no \\`onRowSelect\\` handler has been provided. Provide one to enable row selection or set \\`enableRowSelection\\` to \\`false\\`.`\n );\n }\n\n if (enableRowSelectionSingle && !props.onRowSelect) {\n console.warn(\n `Table (id: ${props.id}) - Row selection (single) is enabled but no \\`onRowSelect\\` handler has been provided. Provide one to enable row selection or set \\`enableRowSelectionSingle\\` to \\`false\\`.`\n );\n }\n }, []);\n\n return {\n // react-table built-in\n enableFiltering: props.enableFiltering ?? presetOptions.enableFiltering,\n enableSearch: props.enableSearch ?? presetOptions.enableSearch,\n enableSorting: props.enableSorting ?? presetOptions.enableSorting,\n enableColumnFreezing: props.enableColumnFreezing ?? presetOptions.enableColumnFreezing,\n enableColumnHiding: props.enableColumnHiding ?? presetOptions.enableColumnHiding,\n enableColumnResizing: props.enableColumnResizing ?? presetOptions.enableColumnResizing,\n enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,\n enableRowSelection: enableRowSelection && !!props.onRowSelect,\n enableRowSelectionSingle: enableRowSelectionSingle && !!props.onRowSelect,\n\n // custom -- common between all table types\n enableColumnOrdering: props.enableColumnOrdering ?? presetOptions.enableColumnOrdering,\n enableFontSize: props.enableFontSize ?? presetOptions.enableFontSize,\n enableFooter: props.enableFooter ?? presetOptions.enableFooter,\n enablePrinting: props.enablePrinting ?? presetOptions.enablePrinting,\n enableRowActive: props.enableRowActive ?? presetOptions.enableRowActive,\n enableRowActions: enableRowActions && !!props.rowActions?.length,\n enableRowClick: enableRowClick && !!props.onRowClick,\n enableRowDrag: enableRowDrag && !!props.onRowDrag,\n enableRowDrop: enableRowDrop && !!props.onRowDrop,\n enableRowGoto: enableRowGoto && !!props.onRowGoto,\n enableRowHeight: props.enableRowHeight ?? presetOptions.enableRowHeight,\n enableSaveSettings: props.enableSaveSettings ?? presetOptions.enableSaveSettings,\n };\n}\n"],"names":["DEFAULT_PRESET","enableFiltering","enableSearch","enableSorting","enableColumnFreezing","enableColumnHiding","enableColumnResizing","enableRowExpansion","enableRowSelection","enableRowSelectionSingle","enableColumnOrdering","enableFontSize","enableFooter","enablePrinting","enableRowActive","enableRowActions","enableRowClick","enableRowDrag","enableRowDrop","enableRowGoto","enableRowHeight","enableSaveSettings","presets","complex","list","simple","useTableFeaturePreset","props","presetOptions","preset","_props$enableRowActio","_props$enableRowClick","_props$enableRowDrag","_props$enableRowDrop","_props$enableRowGoto","_props$enableRowExpan","_props$enableRowSelec","_props$enableRowSelec2","React","useEffect","onRowClick","console","warn","id","onRowGoto","rowExpansionRenderer","onRowSelect","_props$enableFilterin","_props$enableSearch","_props$enableSorting","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnRe","_props$enableColumnOr","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowActiv","_props$rowActions","rowActions","length","onRowDrag","onRowDrop","_props$enableRowHeigh","_props$enableSaveSett"],"mappings":";;AAGA,MAAMA,cAAc,GAAsB;;EAEtCC,eAAe,EAAE,KAAK;EACtBC,YAAY,EAAE,KAAK;EACnBC,aAAa,EAAE,KAAK;EACpBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAA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BAAA,GAAIzB,aAAa,CAAClB,oBAAoB;IACtFC,cAAc,GAAA2C,qBAAA,GAAE3B,KAAK,CAAChB,cAAc,cAAA2C,qBAAA,cAAAA,qBAAA,GAAI1B,aAAa,CAACjB,cAAc;IACpEC,YAAY,GAAA2C,mBAAA,GAAE5B,KAAK,CAACf,YAAY,cAAA2C,mBAAA,cAAAA,mBAAA,GAAI3B,aAAa,CAAChB,YAAY;IAC9DC,cAAc,GAAA2C,qBAAA,GAAE7B,KAAK,CAACd,cAAc,cAAA2C,qBAAA,cAAAA,qBAAA,GAAI5B,aAAa,CAACf,cAAc;IACpEC,eAAe,GAAA2C,qBAAA,GAAE9B,KAAK,CAACb,eAAe,cAAA2C,qBAAA,cAAAA,qBAAA,GAAI7B,aAAa,CAACd,eAAe;IACvEC,gBAAgB,EAAEA,gBAAgB,IAAI,CAAC,GAAA2C,iBAAA,GAAC/B,KAAK,CAACgC,UAAU,cAAAD,iBAAA,eAAhBA,iBAAA,CAAkBE,MAAM;IAChE5C,cAAc,EAAEA,cAAc,IAAI,CAAC,CAACW,KAAK,CAACa,UAAU;IACpDvB,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACU,KAAK,CAACkC,SAAS;IACjD3C,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACS,KAAK,CAACmC,SAAS;IACjD3C,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACQ,KAAK,CAACiB,SAAS;IACjDxB,eAAe,GAAA2C,qBAAA,GAAEpC,KAAK,CAACP,eAAe,cAAA2C,qBAAA,cAAAA,qBAAA,GAAInC,aAAa,CAACR,eAAe;IACvEC,kBAAkB,GAAA2C,qBAAA,GAAErC,KAAK,CAACN,kBAAkB,cAAA2C,qBAAA,cAAAA,qBAAA,GAAIpC,aAAa,CAACP;GACjE;AACL;;;;"}
|
1
|
+
{"version":3,"file":"presets.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/presets.ts"],"sourcesContent":["import { TableFeatureProps, TablePreset, TableProps } from '../../types';\n\nconst DEFAULT_PRESET: TableFeatureProps = {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: false,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: false,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: false,\n};\n\nconst presets: Record<TablePreset, TableFeatureProps> = {\n // View/edit/create on page\n complex: {\n // react-table built-in\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnResizing: true,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: true,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableSaveSettings: true,\n },\n // View/create in dialog\n list: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n // View in card or dialog\n simple: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: false,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n};\n\nexport function getTableFeaturePreset<TType = unknown>(props: TableProps<TType>): TableFeatureProps {\n const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;\n\n const enableRowActions = props.enableRowActions ?? presetOptions.enableRowActions;\n const enableRowClick = props.enableRowClick ?? presetOptions.enableRowClick;\n const enableRowDrag = props.enableRowDrag ?? presetOptions.enableRowDrag;\n const enableRowDrop = props.enableRowDrop ?? presetOptions.enableRowDrop;\n const enableRowGoto = props.enableRowGoto ?? presetOptions.enableRowGoto;\n const enableRowExpansion = props.enableRowExpansion ?? presetOptions.enableRowExpansion;\n const enableRowSelection = props.enableRowSelection ?? presetOptions.enableRowSelection;\n const enableRowSelectionSingle = props.enableRowSelectionSingle ?? presetOptions.enableRowSelectionSingle;\n\n return {\n // react-table built-in\n enableFiltering: props.enableFiltering ?? presetOptions.enableFiltering,\n enableSearch: props.enableSearch ?? presetOptions.enableSearch,\n enableSorting: props.enableSorting ?? presetOptions.enableSorting,\n enableColumnFreezing: props.enableColumnFreezing ?? presetOptions.enableColumnFreezing,\n enableColumnHiding: props.enableColumnHiding ?? presetOptions.enableColumnHiding,\n enableColumnResizing: props.enableColumnResizing ?? presetOptions.enableColumnResizing,\n enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,\n enableRowSelection: enableRowSelection && !!props.onRowSelect,\n enableRowSelectionSingle: enableRowSelectionSingle && !!props.onRowSelect,\n\n // custom -- common between all table types\n enableColumnOrdering: props.enableColumnOrdering ?? presetOptions.enableColumnOrdering,\n enableFontSize: props.enableFontSize ?? presetOptions.enableFontSize,\n enableFooter: props.enableFooter ?? presetOptions.enableFooter,\n enablePrinting: props.enablePrinting ?? presetOptions.enablePrinting,\n enableRowActive: props.enableRowActive ?? presetOptions.enableRowActive,\n enableRowActions: enableRowActions && !!props.rowActions?.length,\n enableRowClick: enableRowClick && !!props.onRowClick,\n enableRowDrag: enableRowDrag && !!props.onRowDrag,\n enableRowDrop: enableRowDrop && !!props.onRowDrop,\n enableRowGoto: enableRowGoto && !!props.onRowGoto,\n enableRowHeight: props.enableRowHeight ?? presetOptions.enableRowHeight,\n enableSaveSettings: props.enableSaveSettings ?? presetOptions.enableSaveSettings,\n };\n}\n"],"names":["DEFAULT_PRESET","enableFiltering","enableSearch","enableSorting","enableColumnFreezing","enableColumnHiding","enableColumnResizing","enableRowExpansion","enableRowSelection","enableRowSelectionSingle","enableColumnOrdering","enableFontSize","enableFooter","enablePrinting","enableRowActive","enableRowActions","enableRowClick","enableRowDrag","enableRowDrop","enableRowGoto","enableRowHeight","enableSaveSettings","presets","complex","list","simple","getTableFeaturePreset","props","presetOptions","preset","_props$enableRowActio","_props$enableRowClick","_props$enableRowDrag","_props$enableRowDrop","_props$enableRowGoto","_props$enableRowExpan","_props$enableRowSelec","_props$enableRowSelec2","_props$enableFilterin","_props$enableSearch","_props$enableSorting","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnRe","rowExpansionRenderer","onRowSelect","_props$enableColumnOr","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowActiv","_props$rowActions","rowActions","length","onRowClick","onRowDrag","onRowDrop","onRowGoto","_props$enableRowHeigh","_props$enableSaveSett"],"mappings":"AAEA,MAAMA,cAAc,GAAsB;;EAEtCC,eAAe,EAAE,KAAK;EACtBC,YAAY,EAAE,KAAK;EACnBC,aAAa,EAAE,KAAK;EACpBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,kBAAkB,EAAE,KAAK;EACzBC,wBAA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