ember-headless-table 1.4.3 → 1.4.5
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/-private/-type-tests/plugin-properties.test.js +1 -1
- package/dist/-private/-type-tests/plugin-properties.test.js.map +1 -1
- package/dist/-private/-type-tests/plugin-with.test.js +0 -1
- package/dist/-private/-type-tests/plugin-with.test.js.map +1 -1
- package/dist/-private/-type-tests/plugins-accessors.test.js +1 -2
- package/dist/-private/-type-tests/plugins-accessors.test.js.map +1 -1
- package/dist/-private/-type-tests/table-api.test.js +0 -1
- package/dist/-private/-type-tests/table-api.test.js.map +1 -1
- package/dist/-private/-type-tests/table-config.test.js +1 -2
- package/dist/-private/-type-tests/table-config.test.js.map +1 -1
- package/dist/-private/column.d.ts +3 -3
- package/dist/-private/column.js.map +1 -1
- package/dist/-private/interfaces/column.d.ts +5 -5
- package/dist/-private/interfaces/index.d.ts +7 -7
- package/dist/-private/interfaces/plugins.d.ts +3 -3
- package/dist/-private/interfaces/table.d.ts +5 -5
- package/dist/-private/js-helper.d.ts +2 -2
- package/dist/-private/js-helper.js +37 -1
- package/dist/-private/js-helper.js.map +1 -1
- package/dist/-private/preferences.d.ts +2 -2
- package/dist/-private/preferences.js +1 -1
- package/dist/-private/preferences.js.map +1 -1
- package/dist/-private/row.d.ts +1 -1
- package/dist/-private/row.js +1 -1
- package/dist/-private/row.js.map +1 -1
- package/dist/-private/table.js +2 -2
- package/dist/-private/utils.d.ts +1 -1
- package/dist/-private/utils.js.map +1 -1
- package/dist/applyDecoratedDescriptor-6b986a67.js.map +1 -1
- package/dist/{classPrivateFieldGet-b4d7d334.js → classPrivateFieldGet-0bfc0262.js} +2 -2
- package/dist/{classPrivateFieldGet-b4d7d334.js.map → classPrivateFieldGet-0bfc0262.js.map} +1 -1
- package/dist/defineProperty-4f0781e1.js +43 -0
- package/dist/defineProperty-4f0781e1.js.map +1 -0
- package/dist/index.d.ts +7 -7
- package/dist/plugins/-private/base.d.ts +6 -6
- package/dist/plugins/-private/base.js +26 -3
- package/dist/plugins/-private/base.js.map +1 -1
- package/dist/plugins/-private/utils.d.ts +2 -2
- package/dist/plugins/-private/utils.js.map +1 -1
- package/dist/plugins/column-reordering/helpers.d.ts +2 -2
- package/dist/plugins/column-reordering/helpers.js.map +1 -1
- package/dist/plugins/column-reordering/index.d.ts +3 -3
- package/dist/plugins/column-reordering/plugin.d.ts +3 -3
- package/dist/plugins/column-reordering/plugin.js +23 -26
- package/dist/plugins/column-reordering/plugin.js.map +1 -1
- package/dist/plugins/column-reordering/utils.d.ts +1 -1
- package/dist/plugins/column-reordering/utils.js.map +1 -1
- package/dist/plugins/column-resizing/handle.d.ts +2 -2
- package/dist/plugins/column-resizing/handle.js +4 -1
- package/dist/plugins/column-resizing/handle.js.map +1 -1
- package/dist/plugins/column-resizing/helpers.d.ts +1 -1
- package/dist/plugins/column-resizing/helpers.js +16 -1
- package/dist/plugins/column-resizing/helpers.js.map +1 -1
- package/dist/plugins/column-resizing/index.d.ts +4 -4
- package/dist/plugins/column-resizing/plugin.d.ts +3 -3
- package/dist/plugins/column-resizing/plugin.js +11 -3
- package/dist/plugins/column-resizing/plugin.js.map +1 -1
- package/dist/plugins/column-resizing/resize-observer.js.map +1 -1
- package/dist/plugins/column-visibility/helpers.d.ts +1 -1
- package/dist/plugins/column-visibility/index.d.ts +3 -3
- package/dist/plugins/column-visibility/plugin.d.ts +3 -3
- package/dist/plugins/column-visibility/plugin.js +1 -1
- package/dist/plugins/column-visibility/plugin.js.map +1 -1
- package/dist/plugins/data-sorting/helpers.d.ts +2 -2
- package/dist/plugins/data-sorting/index.d.ts +5 -5
- package/dist/plugins/data-sorting/plugin.d.ts +4 -4
- package/dist/plugins/data-sorting/plugin.js +1 -1
- package/dist/plugins/data-sorting/plugin.js.map +1 -1
- package/dist/plugins/data-sorting/types.d.ts +1 -1
- package/dist/plugins/data-sorting/types.js +6 -6
- package/dist/plugins/data-sorting/types.js.map +1 -1
- package/dist/plugins/index.d.ts +5 -5
- package/dist/plugins/metadata/helpers.d.ts +1 -1
- package/dist/plugins/metadata/helpers.js.map +1 -1
- package/dist/plugins/metadata/index.d.ts +3 -3
- package/dist/plugins/metadata/plugin.d.ts +1 -1
- package/dist/plugins/metadata/plugin.js +1 -1
- package/dist/plugins/metadata/plugin.js.map +1 -1
- package/dist/plugins/row-selection/helpers.d.ts +1 -1
- package/dist/plugins/row-selection/index.d.ts +3 -3
- package/dist/plugins/row-selection/plugin.d.ts +3 -3
- package/dist/plugins/row-selection/plugin.js +2 -2
- package/dist/plugins/row-selection/plugin.js.map +1 -1
- package/dist/plugins/sticky-columns/helpers.d.ts +1 -1
- package/dist/plugins/sticky-columns/helpers.js +2 -0
- package/dist/plugins/sticky-columns/helpers.js.map +1 -1
- package/dist/plugins/sticky-columns/index.d.ts +3 -3
- package/dist/plugins/sticky-columns/plugin.d.ts +3 -3
- package/dist/plugins/sticky-columns/plugin.js +13 -1
- package/dist/plugins/sticky-columns/plugin.js.map +1 -1
- package/dist/{table-dde25960.d.ts → table-443deac1.d.ts} +6 -6
- package/dist/{table-dde25960.js → table-443deac1.js} +50 -14
- package/dist/{table-dde25960.js.map → table-443deac1.js.map} +1 -1
- package/dist/test-support/index.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
- package/dist/defineProperty-35ce617b.js +0 -16
- package/dist/defineProperty-35ce617b.js.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as _defineProperty } from '../../defineProperty-
|
1
|
+
import { _ as _defineProperty } from '../../defineProperty-4f0781e1.js';
|
2
2
|
import { expectTypeOf } from 'expect-type';
|
3
3
|
import { BasePlugin } from '../../plugins/-private/base.js';
|
4
4
|
import '@ember/debug';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin-properties.test.js","sources":["../../../src/-private/-type-tests/plugin-properties.test.ts"],"sourcesContent":["import { expectTypeOf } from 'expect-type';\n\nimport { BasePlugin } from '../../plugins';\n\nimport type { Table } from '[public-types]';\n\nclass TableMeta {\n a = 'a';\n}\nclass ColumnMeta {\n b = 'b';\n}\nclass RowMeta {\n c = 'c';\n}\nclass A extends BasePlugin<{ Meta: { Table: TableMeta; Column: ColumnMeta; Row: RowMeta } }> {\n name = 'a plugin';\n}\n\nlet x = 0 as unknown as Table;\nlet a = new A(x);\n\n///////////////////////////////////////////////////\n// Meta instantiation\n///////////////////////////////////////////////////\nif (a.meta?.table) {\n expectTypeOf(new a.meta.table()).toEqualTypeOf<TableMeta>();\n}\n\nif (a.meta?.column) {\n expectTypeOf(new a.meta.column()).toEqualTypeOf<ColumnMeta>();\n}\n\nif (a.meta?.row) {\n expectTypeOf(new a.meta.row()).toEqualTypeOf<RowMeta>();\n}\n"],"names":["A","BasePlugin","x","a","meta","table","expectTypeOf","toEqualTypeOf","column","row"],"mappings":";;;;;AAeA,MAAMA,CAAC,SAASC,UAAU,CAAmE;
|
1
|
+
{"version":3,"file":"plugin-properties.test.js","sources":["../../../src/-private/-type-tests/plugin-properties.test.ts"],"sourcesContent":["import { expectTypeOf } from 'expect-type';\n\nimport { BasePlugin } from '../../plugins';\n\nimport type { Table } from '[public-types]';\n\nclass TableMeta {\n a = 'a';\n}\nclass ColumnMeta {\n b = 'b';\n}\nclass RowMeta {\n c = 'c';\n}\nclass A extends BasePlugin<{ Meta: { Table: TableMeta; Column: ColumnMeta; Row: RowMeta } }> {\n name = 'a plugin';\n}\n\nlet x = 0 as unknown as Table;\nlet a = new A(x);\n\n///////////////////////////////////////////////////\n// Meta instantiation\n///////////////////////////////////////////////////\nif (a.meta?.table) {\n expectTypeOf(new a.meta.table()).toEqualTypeOf<TableMeta>();\n}\n\nif (a.meta?.column) {\n expectTypeOf(new a.meta.column()).toEqualTypeOf<ColumnMeta>();\n}\n\nif (a.meta?.row) {\n expectTypeOf(new a.meta.row()).toEqualTypeOf<RowMeta>();\n}\n"],"names":["A","BasePlugin","constructor","args","_defineProperty","x","a","meta","table","expectTypeOf","toEqualTypeOf","column","row"],"mappings":";;;;;AAeA,MAAMA,CAAC,SAASC,UAAU,CAAmE;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,eACpF,UAAU,CAAA,CAAA;AAAA,GAAA;AACnB,CAAA;AAEA,IAAIC,CAAC,GAAG,CAAqB,CAAA;AAC7B,IAAIC,CAAC,GAAG,IAAIN,CAAC,CAACK,CAAC,CAAC,CAAA;;AAEhB;AACA;AACA;AACA,IAAIC,CAAC,CAACC,IAAI,EAAEC,KAAK,EAAE;EACjBC,YAAY,CAAC,IAAIH,CAAC,CAACC,IAAI,CAACC,KAAK,EAAE,CAAC,CAACE,aAAa,EAAa,CAAA;AAC7D,CAAA;AAEA,IAAIJ,CAAC,CAACC,IAAI,EAAEI,MAAM,EAAE;EAClBF,YAAY,CAAC,IAAIH,CAAC,CAACC,IAAI,CAACI,MAAM,EAAE,CAAC,CAACD,aAAa,EAAc,CAAA;AAC/D,CAAA;AAEA,IAAIJ,CAAC,CAACC,IAAI,EAAEK,GAAG,EAAE;EACfH,YAAY,CAAC,IAAIH,CAAC,CAACC,IAAI,CAACK,GAAG,EAAE,CAAC,CAACF,aAAa,EAAW,CAAA;AACzD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin-with.test.js","sources":["../../../src/-private/-type-tests/plugin-with.test.ts"],"sourcesContent":["import { DataSorting } from '../../plugins/data-sorting';\nimport { RowSelection } from '../../plugins/row-selection';\n\nimport type { SortItem } from '../../plugins/data-sorting';\n\nRowSelection.with(() => {\n let simpleOptions = {\n selection: new Set<number>(),\n onSelect: (item: number) => console.debug(item),\n onDeselect: (item: number) => console.debug(item),\n };\n\n return simpleOptions;\n});\n\nDataSorting.with(() => {\n let simpleOptions = {\n onSort: (sorts: SortItem<number>[]) => console.debug(sorts),\n sorts: [] as unknown as SortItem<number>[],\n };\n\n return simpleOptions;\n});\n"],"names":["RowSelection","with","simpleOptions","selection","Set","onSelect","item","console","debug","onDeselect","DataSorting","onSort","sorts"],"mappings":"
|
1
|
+
{"version":3,"file":"plugin-with.test.js","sources":["../../../src/-private/-type-tests/plugin-with.test.ts"],"sourcesContent":["import { DataSorting } from '../../plugins/data-sorting';\nimport { RowSelection } from '../../plugins/row-selection';\n\nimport type { SortItem } from '../../plugins/data-sorting';\n\nRowSelection.with(() => {\n let simpleOptions = {\n selection: new Set<number>(),\n onSelect: (item: number) => console.debug(item),\n onDeselect: (item: number) => console.debug(item),\n };\n\n return simpleOptions;\n});\n\nDataSorting.with(() => {\n let simpleOptions = {\n onSort: (sorts: SortItem<number>[]) => console.debug(sorts),\n sorts: [] as unknown as SortItem<number>[],\n };\n\n return simpleOptions;\n});\n"],"names":["RowSelection","with","simpleOptions","selection","Set","onSelect","item","console","debug","onDeselect","DataSorting","onSort","sorts"],"mappings":";;;;AAKAA,YAAY,CAACC,IAAI,CAAC,MAAM;AACtB,EAAA,IAAIC,aAAa,GAAG;IAClBC,SAAS,EAAE,IAAIC,GAAG,EAAU;IAC5BC,QAAQ,EAAGC,IAAY,IAAKC,OAAO,CAACC,KAAK,CAACF,IAAI,CAAC;AAC/CG,IAAAA,UAAU,EAAGH,IAAY,IAAKC,OAAO,CAACC,KAAK,CAACF,IAAI,CAAA;GACjD,CAAA;AAED,EAAA,OAAOJ,aAAa,CAAA;AACtB,CAAC,CAAC,CAAA;AAEFQ,OAAW,CAACT,IAAI,CAAC,MAAM;AACrB,EAAA,IAAIC,aAAa,GAAG;IAClBS,MAAM,EAAGC,KAAyB,IAAKL,OAAO,CAACC,KAAK,CAACI,KAAK,CAAC;AAC3DA,IAAAA,KAAK,EAAE,EAAA;GACR,CAAA;AAED,EAAA,OAAOV,aAAa,CAAA;AACtB,CAAC,CAAC"}
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import { _ as _defineProperty } from '../../defineProperty-
|
1
|
+
import { _ as _defineProperty } from '../../defineProperty-4f0781e1.js';
|
2
2
|
import { options, meta, preferences, BasePlugin } from '../../plugins/-private/base.js';
|
3
3
|
import '@ember/debug';
|
4
4
|
import { expectTypeOf } from 'expect-type';
|
5
5
|
import { Sorting } from '../../plugins/data-sorting/plugin.js';
|
6
|
-
import '../../plugins/data-sorting/types.js';
|
7
6
|
|
8
7
|
// This value is irrelevant for the tests it's used in
|
9
8
|
const x = 0;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins-accessors.test.js","sources":["../../../src/-private/-type-tests/plugins-accessors.test.ts"],"sourcesContent":["import { BasePlugin, meta, options, preferences } from 'ember-headless-table/plugins';\nimport { expectTypeOf } from 'expect-type';\n\nimport type { Column, Table } from '[public-types]';\n\n// This value is irrelevant for the tests it's used in\nconst x = 0 as unknown as Table<unknown>;\nconst y = 0 as unknown as Column<unknown>;\n\n//////////////////////////////////////////////\n// A SimplePlugin\n//////////////////////////////////////////////\nclass ATableMeta {\n isEnabled = true;\n}\nclass AColumnMeta {\n isPinned = 1;\n}\nclass ARowMeta {\n isARow = true;\n}\ninterface AOptions {\n enabled?: boolean;\n}\ninterface AColumnOptions {\n isPinned?: boolean;\n}\n\ninterface SignatureA {\n Meta: {\n Table: ATableMeta;\n Column: AColumnMeta;\n Row: ARowMeta;\n };\n Options: {\n Plugin: AOptions;\n Column: AColumnOptions;\n };\n}\n\nclass SimplePlugin<Signature = SignatureA> extends BasePlugin<Signature> {\n name = 'my-test-plugin';\n}\n\n// Options\nexpectTypeOf(options.forTable(x, SimplePlugin)).toEqualTypeOf<AOptions>();\nexpectTypeOf(options.forColumn(y, SimplePlugin)).toEqualTypeOf<AColumnOptions>();\n\n// Meta\nexpectTypeOf(meta.forTable(x, SimplePlugin)).toEqualTypeOf<ATableMeta>();\nexpectTypeOf(meta.forColumn(y, SimplePlugin)).toEqualTypeOf<AColumnMeta>();\n\n// Preferences\ninterface MapLite {\n get(key: string): unknown;\n set(key: string, value: unknown): void | undefined;\n delete(key: string): void | undefined;\n}\nexpectTypeOf(preferences.forTable(x, SimplePlugin)).toEqualTypeOf<MapLite>();\nexpectTypeOf(preferences.forColumn(y, SimplePlugin)).toEqualTypeOf<MapLite>();\n\n//////////////////////////////////////////////\n// A Real plugin\n//////////////////////////////////////////////\n\nimport { DataSorting } from '../../plugins/data-sorting';\n\nimport type { Signature as DataSortingSignature } from '../../plugins/data-sorting';\n\n// Options\nexpectTypeOf(options.forTable(x, DataSorting)).toEqualTypeOf<\n DataSortingSignature['Options']['Plugin']\n>();\nexpectTypeOf(options.forColumn(y, DataSorting)).toEqualTypeOf<\n DataSortingSignature['Options']['Column']\n>();\n\n// Meta\nexpectTypeOf(meta.forTable(x, DataSorting)).toEqualTypeOf<DataSortingSignature['Meta']['Table']>();\nexpectTypeOf(meta.forColumn(y, DataSorting)).toEqualTypeOf<\n DataSortingSignature['Meta']['Column']\n>();\n"],"names":["x","y","SimplePlugin","BasePlugin","expectTypeOf","options","forTable","toEqualTypeOf","forColumn","meta","preferences","DataSorting"],"mappings":"
|
1
|
+
{"version":3,"file":"plugins-accessors.test.js","sources":["../../../src/-private/-type-tests/plugins-accessors.test.ts"],"sourcesContent":["import { BasePlugin, meta, options, preferences } from 'ember-headless-table/plugins';\nimport { expectTypeOf } from 'expect-type';\n\nimport type { Column, Table } from '[public-types]';\n\n// This value is irrelevant for the tests it's used in\nconst x = 0 as unknown as Table<unknown>;\nconst y = 0 as unknown as Column<unknown>;\n\n//////////////////////////////////////////////\n// A SimplePlugin\n//////////////////////////////////////////////\nclass ATableMeta {\n isEnabled = true;\n}\nclass AColumnMeta {\n isPinned = 1;\n}\nclass ARowMeta {\n isARow = true;\n}\ninterface AOptions {\n enabled?: boolean;\n}\ninterface AColumnOptions {\n isPinned?: boolean;\n}\n\ninterface SignatureA {\n Meta: {\n Table: ATableMeta;\n Column: AColumnMeta;\n Row: ARowMeta;\n };\n Options: {\n Plugin: AOptions;\n Column: AColumnOptions;\n };\n}\n\nclass SimplePlugin<Signature = SignatureA> extends BasePlugin<Signature> {\n name = 'my-test-plugin';\n}\n\n// Options\nexpectTypeOf(options.forTable(x, SimplePlugin)).toEqualTypeOf<AOptions>();\nexpectTypeOf(options.forColumn(y, SimplePlugin)).toEqualTypeOf<AColumnOptions>();\n\n// Meta\nexpectTypeOf(meta.forTable(x, SimplePlugin)).toEqualTypeOf<ATableMeta>();\nexpectTypeOf(meta.forColumn(y, SimplePlugin)).toEqualTypeOf<AColumnMeta>();\n\n// Preferences\ninterface MapLite {\n get(key: string): unknown;\n set(key: string, value: unknown): void | undefined;\n delete(key: string): void | undefined;\n}\nexpectTypeOf(preferences.forTable(x, SimplePlugin)).toEqualTypeOf<MapLite>();\nexpectTypeOf(preferences.forColumn(y, SimplePlugin)).toEqualTypeOf<MapLite>();\n\n//////////////////////////////////////////////\n// A Real plugin\n//////////////////////////////////////////////\n\nimport { DataSorting } from '../../plugins/data-sorting';\n\nimport type { Signature as DataSortingSignature } from '../../plugins/data-sorting';\n\n// Options\nexpectTypeOf(options.forTable(x, DataSorting)).toEqualTypeOf<\n DataSortingSignature['Options']['Plugin']\n>();\nexpectTypeOf(options.forColumn(y, DataSorting)).toEqualTypeOf<\n DataSortingSignature['Options']['Column']\n>();\n\n// Meta\nexpectTypeOf(meta.forTable(x, DataSorting)).toEqualTypeOf<DataSortingSignature['Meta']['Table']>();\nexpectTypeOf(meta.forColumn(y, DataSorting)).toEqualTypeOf<\n DataSortingSignature['Meta']['Column']\n>();\n"],"names":["x","y","SimplePlugin","BasePlugin","constructor","args","_defineProperty","expectTypeOf","options","forTable","toEqualTypeOf","forColumn","meta","preferences","DataSorting"],"mappings":";;;;;;AAKA;AACA,MAAMA,CAAC,GAAG,CAA8B,CAAA;AACxC,MAAMC,CAAC,GAAG,CAA+B,CAAA;AAiCzC,MAAMC,YAAY,SAAiCC,UAAU,CAAY;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAA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from '../../plugins/column-resizing/plugin.js';
|
7
7
|
import { Sorting } from '../../plugins/data-sorting/plugin.js';
|
8
|
-
import '../../plugins/data-sorting/types.js';
|
9
8
|
|
10
9
|
// We're testing types, not behaviors
|
11
10
|
const x = 0;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table-api.test.js","sources":["../../../src/-private/-type-tests/table-api.test.ts"],"sourcesContent":["import { expectTypeOf } from 'expect-type';\n\nimport { ColumnReordering } from '../../plugins/column-reordering';\nimport { ColumnResizing } from '../../plugins/column-resizing';\nimport { DataSorting } from '../../plugins/data-sorting';\n\nimport type { Table } from '[public-types]';\n\n// We're testing types, not behaviors\nconst x = 0 as unknown as Table<{ x: number }>;\n\n//////////////////////////////\n// <Table>#pluginOf\nexpectTypeOf(x.pluginOf(DataSorting)).toEqualTypeOf<DataSorting | undefined>();\nexpectTypeOf(x.pluginOf(ColumnReordering)).toEqualTypeOf<ColumnReordering | undefined>();\nexpectTypeOf(x.pluginOf(ColumnResizing)).toEqualTypeOf<ColumnResizing | undefined>();\n"],"names":["x","expectTypeOf","pluginOf","DataSorting","toEqualTypeOf","ColumnReordering","ColumnResizing"],"mappings":"
|
1
|
+
{"version":3,"file":"table-api.test.js","sources":["../../../src/-private/-type-tests/table-api.test.ts"],"sourcesContent":["import { expectTypeOf } from 'expect-type';\n\nimport { ColumnReordering } from '../../plugins/column-reordering';\nimport { ColumnResizing } from '../../plugins/column-resizing';\nimport { DataSorting } from '../../plugins/data-sorting';\n\nimport type { Table } from '[public-types]';\n\n// We're testing types, not behaviors\nconst x = 0 as unknown as Table<{ x: number }>;\n\n//////////////////////////////\n// <Table>#pluginOf\nexpectTypeOf(x.pluginOf(DataSorting)).toEqualTypeOf<DataSorting | undefined>();\nexpectTypeOf(x.pluginOf(ColumnReordering)).toEqualTypeOf<ColumnReordering | undefined>();\nexpectTypeOf(x.pluginOf(ColumnResizing)).toEqualTypeOf<ColumnResizing | undefined>();\n"],"names":["x","expectTypeOf","pluginOf","DataSorting","toEqualTypeOf","ColumnReordering","ColumnResizing"],"mappings":";;;;;;;;AAQA;AACA,MAAMA,CAAC,GAAG,CAAoC,CAAA;;AAE9C;AACA;AACAC,YAAY,CAACD,CAAC,CAACE,QAAQ,CAACC,OAAW,CAAC,CAAC,CAACC,aAAa,EAA2B,CAAA;AAC9EH,YAAY,CAACD,CAAC,CAACE,QAAQ,CAACG,gBAAgB,CAAC,CAAC,CAACD,aAAa,EAAgC,CAAA;AACxFH,YAAY,CAACD,CAAC,CAACE,QAAQ,CAACI,cAAc,CAAC,CAAC,CAACF,aAAa,EAA8B"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as _defineProperty } from '../../defineProperty-
|
1
|
+
import { _ as _defineProperty } from '../../defineProperty-4f0781e1.js';
|
2
2
|
import { expectTypeOf } from 'expect-type';
|
3
3
|
import { BasePlugin } from '../../plugins/-private/base.js';
|
4
4
|
import { ColumnReordering } from '../../plugins/column-reordering/plugin.js';
|
@@ -7,7 +7,6 @@ import '@ember/template';
|
|
7
7
|
import { ColumnResizing } from '../../plugins/column-resizing/plugin.js';
|
8
8
|
import { ColumnVisibility } from '../../plugins/column-visibility/plugin.js';
|
9
9
|
import { Sorting } from '../../plugins/data-sorting/plugin.js';
|
10
|
-
import '../../plugins/data-sorting/types.js';
|
11
10
|
import { StickyColumns } from '../../plugins/sticky-columns/plugin.js';
|
12
11
|
|
13
12
|
/////////////////////////////////////////////
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table-config.test.js","sources":["../../../src/-private/-type-tests/table-config.test.ts"],"sourcesContent":["import { expectTypeOf } from 'expect-type';\n\nimport { BasePlugin } from '../../plugins/-private/base';\nimport { ColumnReordering } from '../../plugins/column-reordering';\nimport { ColumnResizing } from '../../plugins/column-resizing';\nimport { ColumnVisibility } from '../../plugins/column-visibility';\nimport { DataSorting } from '../../plugins/data-sorting';\nimport { StickyColumns } from '../../plugins/sticky-columns';\n\nimport type { Plugins } from '../../plugins/-private/utils';\nimport type { SortItem } from '../../plugins/data-sorting';\nimport type { Plugin } from '[public-plugin-types]';\nimport type { TableConfig } from '[public-types]';\nimport type { Constructor } from '#private-types';\n\ntype TablePluginConfig = NonNullable<TableConfig<unknown>['plugins']>;\n\n/////////////////////////////////////////////\n// Sanity checks\nexpectTypeOf<Plugins>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<Constructor<Plugin>[]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<[Constructor<Plugin>]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<[Constructor<Plugin>, Constructor<Plugin>]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<Constructor<BasePlugin>[]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<[Constructor<BasePlugin>]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<\n [Constructor<BasePlugin>, Constructor<BasePlugin>]\n>().toMatchTypeOf<TablePluginConfig>();\n\nclass SomeClass {\n foo = 'bar';\n}\nclass LocalPlugin extends BasePlugin<{ Meta: { Table: SomeClass } }> {\n name = 'local-plugin';\n}\n\nexpectTypeOf([LocalPlugin]).toMatchTypeOf<TablePluginConfig>();\n\n/////////////////////////////////////////////\n// Making sure all plugins are subclassed appropriately\nexpectTypeOf(LocalPlugin).toMatchTypeOf<Constructor<BasePlugin<any>>>();\nexpectTypeOf(ColumnReordering).toMatchTypeOf<Constructor<BasePlugin<any>>>();\nexpectTypeOf(LocalPlugin).toMatchTypeOf<Constructor<Plugin<any>>>();\nexpectTypeOf(ColumnReordering).toMatchTypeOf<Constructor<Plugin<any>>>();\n\n// Actual plugins match the actual table config\nexpectTypeOf([DataSorting]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([ColumnReordering]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([ColumnResizing]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([ColumnVisibility]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([StickyColumns]).toMatchTypeOf<TablePluginConfig>();\n\n/////////////////////////////////////////////\n// The various ways to define plugins\nexpectTypeOf([DataSorting, ColumnReordering]).toMatchTypeOf<TablePluginConfig>();\n\nconst onSort = (_sorts: SortItem<number>[]) => {\n /* intentionally empty */\n};\nconst sorts: SortItem<number>[] = [];\n\nexpectTypeOf([DataSorting.with(() => ({}))]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([DataSorting.with(() => ({ onSort, sorts }))]).toMatchTypeOf<TablePluginConfig>();\n"],"names":["expectTypeOf","toMatchTypeOf","LocalPlugin","BasePlugin","ColumnReordering","DataSorting","ColumnResizing","ColumnVisibility","StickyColumns","onSort","_sorts","sorts","with"],"mappings":"
|
1
|
+
{"version":3,"file":"table-config.test.js","sources":["../../../src/-private/-type-tests/table-config.test.ts"],"sourcesContent":["import { expectTypeOf } from 'expect-type';\n\nimport { BasePlugin } from '../../plugins/-private/base';\nimport { ColumnReordering } from '../../plugins/column-reordering';\nimport { ColumnResizing } from '../../plugins/column-resizing';\nimport { ColumnVisibility } from '../../plugins/column-visibility';\nimport { DataSorting } from '../../plugins/data-sorting';\nimport { StickyColumns } from '../../plugins/sticky-columns';\n\nimport type { Plugins } from '../../plugins/-private/utils';\nimport type { SortItem } from '../../plugins/data-sorting';\nimport type { Plugin } from '[public-plugin-types]';\nimport type { TableConfig } from '[public-types]';\nimport type { Constructor } from '#private-types';\n\ntype TablePluginConfig = NonNullable<TableConfig<unknown>['plugins']>;\n\n/////////////////////////////////////////////\n// Sanity checks\nexpectTypeOf<Plugins>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<Constructor<Plugin>[]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<[Constructor<Plugin>]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<[Constructor<Plugin>, Constructor<Plugin>]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<Constructor<BasePlugin>[]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<[Constructor<BasePlugin>]>().toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf<\n [Constructor<BasePlugin>, Constructor<BasePlugin>]\n>().toMatchTypeOf<TablePluginConfig>();\n\nclass SomeClass {\n foo = 'bar';\n}\nclass LocalPlugin extends BasePlugin<{ Meta: { Table: SomeClass } }> {\n name = 'local-plugin';\n}\n\nexpectTypeOf([LocalPlugin]).toMatchTypeOf<TablePluginConfig>();\n\n/////////////////////////////////////////////\n// Making sure all plugins are subclassed appropriately\nexpectTypeOf(LocalPlugin).toMatchTypeOf<Constructor<BasePlugin<any>>>();\nexpectTypeOf(ColumnReordering).toMatchTypeOf<Constructor<BasePlugin<any>>>();\nexpectTypeOf(LocalPlugin).toMatchTypeOf<Constructor<Plugin<any>>>();\nexpectTypeOf(ColumnReordering).toMatchTypeOf<Constructor<Plugin<any>>>();\n\n// Actual plugins match the actual table config\nexpectTypeOf([DataSorting]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([ColumnReordering]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([ColumnResizing]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([ColumnVisibility]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([StickyColumns]).toMatchTypeOf<TablePluginConfig>();\n\n/////////////////////////////////////////////\n// The various ways to define plugins\nexpectTypeOf([DataSorting, ColumnReordering]).toMatchTypeOf<TablePluginConfig>();\n\nconst onSort = (_sorts: SortItem<number>[]) => {\n /* intentionally empty */\n};\nconst sorts: SortItem<number>[] = [];\n\nexpectTypeOf([DataSorting.with(() => ({}))]).toMatchTypeOf<TablePluginConfig>();\nexpectTypeOf([DataSorting.with(() => ({ onSort, sorts }))]).toMatchTypeOf<TablePluginConfig>();\n"],"names":["expectTypeOf","toMatchTypeOf","LocalPlugin","BasePlugin","constructor","args","_defineProperty","ColumnReordering","DataSorting","ColumnResizing","ColumnVisibility","StickyColumns","onSort","_sorts","sorts","with"],"mappings":";;;;;;;;;;;AAiBA;AACA;AAC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ED,gBAAgB,CAAC,CAAC,CAACN,aAAa,EAAqB,CAAA;AAEhF,MAAMW,MAAM,GAAIC,MAA0B,IAAK;AAC7C;AAAA,CACD,CAAA;AACD,MAAMC,KAAyB,GAAG,EAAE,CAAA;AAEpCd,YAAY,CAAC,CAACQ,OAAW,CAACO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAACd,aAAa,EAAqB,CAAA;AAC/ED,YAAY,CAAC,CAACQ,OAAW,CAACO,IAAI,CAAC,OAAO;EAAEH,MAAM;AAAEE,EAAAA,KAAAA;AAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAACb,aAAa,EAAqB"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Row } from "./row";
|
2
|
-
import { Table } from "../table-
|
1
|
+
import { Row } from "./row.js";
|
2
|
+
import { Table } from "../table-443deac1.js";
|
3
3
|
import { ContentValue } from '@glint/template';
|
4
|
-
import { ColumnConfig } from "./interfaces/index";
|
4
|
+
import { ColumnConfig } from "./interfaces/index.js";
|
5
5
|
declare class Column<T = unknown> {
|
6
6
|
table: Table<T>;
|
7
7
|
config: ColumnConfig<T>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"column.js","sources":["../../src/-private/column.ts"],"sourcesContent":["import { action, get } from '@ember/object';\nimport { isEmpty } from '@ember/utils';\n\nimport type { Row } from './row';\nimport type { Table } from './table';\nimport type { ContentValue } from '@glint/template';\nimport type { ColumnConfig } from '#interfaces';\n\nconst DEFAULT_VALUE = '--';\nconst DEFAULT_VALUE_KEY = 'defaultValue';\nconst DEFAULT_OPTIONS = {\n [DEFAULT_VALUE_KEY]: DEFAULT_VALUE,\n};\n\nexport class Column<T = unknown> {\n get Cell() {\n return this.config.Cell;\n }\n\n get key() {\n return this.config.key;\n }\n\n get name() {\n return this.config.name;\n }\n\n constructor(public table: Table<T>, public config: ColumnConfig<T>) {}\n\n @action\n getValueForRow(row: Row<T>): ContentValue {\n if (this.config.value) {\n return this.config.value({ column: this, row });\n }\n\n // Cast here, because ember get's types do not support nested keys\n // even though the real implementation does\n let value = get(row.data, this.config.key as keyof typeof row.data);\n\n if (isEmpty(value)) {\n return this.getDefaultValue(row);\n }\n\n /**\n * UNSAFE: casting to ContentValue is incorrect, because we have not\n * properly constrained the type of value, (isEmpty doesn't narrow types either)\n */\n return value as ContentValue;\n }\n\n private getDefaultValue(row: Row<T>) {\n return this.getOptionsForRow(row)[DEFAULT_VALUE_KEY];\n }\n\n @action\n getOptionsForRow(row: Row<T>) {\n let defaults = DEFAULT_OPTIONS;\n\n return {\n ...defaults,\n ...this.config.options?.({ column: this, row }),\n };\n }\n}\n"],"names":["DEFAULT_VALUE","DEFAULT_VALUE_KEY","DEFAULT_OPTIONS","Column","Cell","config","key","name","constructor","table","getValueForRow","row","value","column","get","data","isEmpty","getDefaultValue","getOptionsForRow","defaults","options","action"],"mappings":";;;;;AAQA,MAAMA,aAAa,GAAG,IAAI,CAAA;AAC1B,MAAMC,iBAAiB,GAAG,cAAc,CAAA;AACxC,MAAMC,eAAe,GAAG;AACtB,EAAA,CAACD,iBAAiB,GAAGD,aAAAA;AACvB,CAAC,CAAA;AAED,IAAaG,MAAM,
|
1
|
+
{"version":3,"file":"column.js","sources":["../../src/-private/column.ts"],"sourcesContent":["import { action, get } from '@ember/object';\nimport { isEmpty } from '@ember/utils';\n\nimport type { Row } from './row';\nimport type { Table } from './table';\nimport type { ContentValue } from '@glint/template';\nimport type { ColumnConfig } from '#interfaces';\n\nconst DEFAULT_VALUE = '--';\nconst DEFAULT_VALUE_KEY = 'defaultValue';\nconst DEFAULT_OPTIONS = {\n [DEFAULT_VALUE_KEY]: DEFAULT_VALUE,\n};\n\nexport class Column<T = unknown> {\n get Cell() {\n return this.config.Cell;\n }\n\n get key() {\n return this.config.key;\n }\n\n get name() {\n return this.config.name;\n }\n\n constructor(public table: Table<T>, public config: ColumnConfig<T>) {}\n\n @action\n getValueForRow(row: Row<T>): ContentValue {\n if (this.config.value) {\n return this.config.value({ column: this, row });\n }\n\n // Cast here, because ember get's types do not support nested keys\n // even though the real implementation does\n let value = get(row.data, this.config.key as keyof typeof row.data);\n\n if (isEmpty(value)) {\n return this.getDefaultValue(row);\n }\n\n /**\n * UNSAFE: casting to ContentValue is incorrect, because we have not\n * properly constrained the type of value, (isEmpty doesn't narrow types either)\n */\n return value as ContentValue;\n }\n\n private getDefaultValue(row: Row<T>) {\n return this.getOptionsForRow(row)[DEFAULT_VALUE_KEY];\n }\n\n @action\n getOptionsForRow(row: Row<T>) {\n let defaults = DEFAULT_OPTIONS;\n\n return {\n ...defaults,\n ...this.config.options?.({ column: this, row }),\n };\n }\n}\n"],"names":["DEFAULT_VALUE","DEFAULT_VALUE_KEY","DEFAULT_OPTIONS","Column","_class","Cell","config","key","name","constructor","table","getValueForRow","row","value","column","get","data","isEmpty","getDefaultValue","getOptionsForRow","defaults","options","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;AAQA,MAAMA,aAAa,GAAG,IAAI,CAAA;AAC1B,MAAMC,iBAAiB,GAAG,cAAc,CAAA;AACxC,MAAMC,eAAe,GAAG;AACtB,EAAA,CAACD,iBAAiB,GAAGD,aAAAA;AACvB,CAAC,CAAA;AAED,IAAaG,MAAM,IAAAC,MAAA,GAAZ,MAAMD,MAAM,CAAc;EAC/B,IAAIE,IAAIA,GAAG;AACT,IAAA,OAAO,IAAI,CAACC,MAAM,CAACD,IAAI,CAAA;AACzB,GAAA;EAEA,IAAIE,GAAGA,GAAG;AACR,IAAA,OAAO,IAAI,CAACD,MAAM,CAACC,GAAG,CAAA;AACxB,GAAA;EAEA,IAAIC,IAAIA,GAAG;AACT,IAAA,OAAO,IAAI,CAACF,MAAM,CAACE,IAAI,CAAA;AACzB,GAAA;AAEAC,EAAAA,WAAWA,CAAQC,KAAe,EAASJ,MAAuB,EAAE;IAAA,IAAjDI,CAAAA,KAAe,GAAfA,KAAe,CAAA;IAAA,IAASJ,CAAAA,MAAu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GAAAC,MAAA,CAAAC,wBAAA,CAAAtB,MAAA,CAAAmB,SAAA,EAAA,kBAAA,CAAA,EAAAnB,MAAA,CAAAmB,SAAA,IAAAnB,MAAA;;;;"}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { BasePlugin, Plugin } from "../../plugins/index";
|
2
|
-
import { Column } from "../column";
|
3
|
-
import { Row } from "../row";
|
4
|
-
import { ColumnOptionsFor, SignatureFrom } from "./plugins";
|
5
|
-
import { Constructor } from "../private-types";
|
1
|
+
import { BasePlugin, Plugin } from "../../plugins/index.js";
|
2
|
+
import { Column } from "../column.js";
|
3
|
+
import { Row } from "../row.js";
|
4
|
+
import { ColumnOptionsFor, SignatureFrom } from "./plugins.js";
|
5
|
+
import { Constructor } from "../private-types.js";
|
6
6
|
import { ComponentLike, ContentValue } from '@glint/template';
|
7
7
|
interface CellContext<T> {
|
8
8
|
column: Column<T>;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from "./column";
|
2
|
-
export * from "./modifier";
|
3
|
-
export * from "./pagination";
|
4
|
-
export * from "./plugins";
|
5
|
-
export * from "./preferences";
|
6
|
-
export * from "./selection";
|
7
|
-
export * from "./table";
|
1
|
+
export * from "./column.js";
|
2
|
+
export * from "./modifier.js";
|
3
|
+
export * from "./pagination.js";
|
4
|
+
export * from "./plugins.js";
|
5
|
+
export * from "./preferences.js";
|
6
|
+
export * from "./selection.js";
|
7
|
+
export * from "./table.js";
|
@@ -2,9 +2,9 @@
|
|
2
2
|
* NOTE:
|
3
3
|
* Empty, EmptyObject, and GetOrElse are copied from @glimmer/component
|
4
4
|
*/
|
5
|
-
import { Constructor } from "../private-types";
|
6
|
-
import { Column, Row, Table } from "../../index";
|
7
|
-
import { Destructor } from "./index";
|
5
|
+
import { Constructor } from "../private-types.js";
|
6
|
+
import { Column, Row, Table } from "../../index.js";
|
7
|
+
import { Destructor } from "./index.js";
|
8
8
|
type DataTypeOf<T> = T extends Table<infer DataType> ? DataType : T;
|
9
9
|
/**
|
10
10
|
* @private utility class
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { Plugins } from "../../plugins/-private/utils";
|
2
|
-
import { ColumnConfig } from "./column";
|
3
|
-
import { Pagination } from "./pagination";
|
4
|
-
import { PreferencesAdapter } from "./preferences";
|
5
|
-
import { Selection } from "./selection";
|
1
|
+
import { Plugins } from "../../plugins/-private/utils.js";
|
2
|
+
import { ColumnConfig } from "./column.js";
|
3
|
+
import { Pagination } from "./pagination.js";
|
4
|
+
import { PreferencesAdapter } from "./preferences.js";
|
5
|
+
import { Selection } from "./selection.js";
|
6
6
|
interface TableMeta {
|
7
7
|
totalRowCount?: number;
|
8
8
|
totalRowsSelectedCount?: number;
|
@@ -1,4 +1,40 @@
|
|
1
|
-
import {
|
1
|
+
import { T as Table } from '../table-443deac1.js';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Represents a UI-less version of a table
|
5
|
+
*
|
6
|
+
* _For use for building tables in ui frameworks_.
|
7
|
+
*
|
8
|
+
* @example
|
9
|
+
* ```js
|
10
|
+
* import { use } from 'ember-resources';
|
11
|
+
* import { headlessTable } '@crowdstrike/ember-headless-table';
|
12
|
+
*
|
13
|
+
* class MyImplementation {
|
14
|
+
* @use table = headlessTable({
|
15
|
+
* // your config here
|
16
|
+
* })
|
17
|
+
* }
|
18
|
+
* ```
|
19
|
+
*/
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Represents a UI-less version of a table
|
23
|
+
*
|
24
|
+
* _For use for building tables in ui frameworks_.
|
25
|
+
*
|
26
|
+
* @example
|
27
|
+
* ```js
|
28
|
+
* import { headlessTable } '@crowdstrike/ember-headless-table';
|
29
|
+
*
|
30
|
+
* class MyImplementation {
|
31
|
+
* table = headlessTable(this, {
|
32
|
+
* // your config here
|
33
|
+
* })
|
34
|
+
* }
|
35
|
+
* ```
|
36
|
+
*
|
37
|
+
*/
|
2
38
|
|
3
39
|
function headlessTable(...args) {
|
4
40
|
if (args.length === 2) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"js-helper.js","sources":["../../src/-private/js-helper.ts"],"sourcesContent":["import { Table } from './table';\n\nimport type { TableConfig } from '#interfaces';\n\ntype Args<T> = [destroyable: object, options: TableConfig<T>] | [options: TableConfig<T>];\n\n/**\n * Represents a UI-less version of a table\n *\n * _For use for building tables in ui frameworks_.\n *\n * @example\n * ```js\n * import { use } from 'ember-resources';\n * import { headlessTable } '@crowdstrike/ember-headless-table';\n *\n * class MyImplementation {\n * @use table = headlessTable({\n * // your config here\n * })\n * }\n * ```\n */\nexport function headlessTable<T = unknown>(options: TableConfig<T>): Table<T>;\n\n/**\n * Represents a UI-less version of a table\n *\n * _For use for building tables in ui frameworks_.\n *\n * @example\n * ```js\n * import { headlessTable } '@crowdstrike/ember-headless-table';\n *\n * class MyImplementation {\n * table = headlessTable(this, {\n * // your config here\n * })\n * }\n * ```\n *\n */\nexport function headlessTable<T = unknown>(destroyable: object, options: TableConfig<T>): Table<T>;\n\nexport function headlessTable<T = unknown>(...args: Args<T>): Table<T> {\n if (args.length === 2) {\n let [destroyable, options] = args;\n\n /**\n * If any \"root level\" config changes, we need to throw-away everything.\n * otherwise individual-property reactivity can be managed on a per-property\n * \"thunk\"-basis\n */\n return Table.from<Table<T>>(destroyable, () => options);\n }\n\n let [options] = args;\n\n return Table.from<Table<T>>(() => options);\n}\n"],"names":["headlessTable","args","length","destroyable","options","Table","from"],"mappings":";;
|
1
|
+
{"version":3,"file":"js-helper.js","sources":["../../src/-private/js-helper.ts"],"sourcesContent":["import { Table } from './table';\n\nimport type { TableConfig } from '#interfaces';\n\ntype Args<T> = [destroyable: object, options: TableConfig<T>] | [options: TableConfig<T>];\n\n/**\n * Represents a UI-less version of a table\n *\n * _For use for building tables in ui frameworks_.\n *\n * @example\n * ```js\n * import { use } from 'ember-resources';\n * import { headlessTable } '@crowdstrike/ember-headless-table';\n *\n * class MyImplementation {\n * @use table = headlessTable({\n * // your config here\n * })\n * }\n * ```\n */\nexport function headlessTable<T = unknown>(options: TableConfig<T>): Table<T>;\n\n/**\n * Represents a UI-less version of a table\n *\n * _For use for building tables in ui frameworks_.\n *\n * @example\n * ```js\n * import { headlessTable } '@crowdstrike/ember-headless-table';\n *\n * class MyImplementation {\n * table = headlessTable(this, {\n * // your config here\n * })\n * }\n * ```\n *\n */\nexport function headlessTable<T = unknown>(destroyable: object, options: TableConfig<T>): Table<T>;\n\nexport function headlessTable<T = unknown>(...args: Args<T>): Table<T> {\n if (args.length === 2) {\n let [destroyable, options] = args;\n\n /**\n * If any \"root level\" config changes, we need to throw-away everything.\n * otherwise individual-property reactivity can be managed on a per-property\n * \"thunk\"-basis\n */\n return Table.from<Table<T>>(destroyable, () => options);\n }\n\n let [options] = args;\n\n return Table.from<Table<T>>(() => options);\n}\n"],"names":["headlessTable","args","length","destroyable","options","Table","from"],"mappings":";;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGO,SAASA,aAAaA,CAAc,GAAGC,IAAa,EAAY;AACrE,EAAA,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;AACrB,IAAA,IAAI,CAACC,WAAW,EAAEC,OAAO,CAAC,GAAGH,IAAI,CAAA;;AAEjC;AACJ;AACA;AACA;AACA;IACI,OAAOI,KAAK,CAACC,IAAI,CAAWH,WAAW,EAAE,MAAMC,OAAO,CAAC,CAAA;AACzD,GAAA;AAEA,EAAA,IAAI,CAACA,OAAO,CAAC,GAAGH,IAAI,CAAA;AAEpB,EAAA,OAAOI,KAAK,CAACC,IAAI,CAAW,MAAMF,OAAO,CAAC,CAAA;AAC5C;;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { TrackedMap } from 'tracked-built-ins';
|
2
|
-
import { PluginPreferenceFor, PluginPreferences, TablePreferencesData } from "./interfaces/index";
|
3
|
-
import { PreferencesAdapter as Adapter } from "./interfaces/index";
|
2
|
+
import { PluginPreferenceFor, PluginPreferences, TablePreferencesData } from "./interfaces/index.js";
|
3
|
+
import { PreferencesAdapter as Adapter } from "./interfaces/index.js";
|
4
4
|
declare class TablePreferences {
|
5
5
|
private key;
|
6
6
|
private adapter?;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"preferences.js","sources":["../../src/-private/preferences.ts"],"sourcesContent":["import { TrackedMap } from 'tracked-built-ins';\n\nimport type {\n PluginPreferenceFor,\n PluginPreferences,\n PreferencesAdapter as Adapter,\n PreferencesTableValues,\n TablePreferencesData,\n} from '#interfaces';\n\nexport class TablePreferences {\n storage = new TrackedPreferences();\n\n constructor(private key: string, private adapter?: Adapter) {\n if (this.adapter) {\n this.restore(this.adapter);\n }\n }\n\n hasAdapter() {\n return this.adapter !== undefined;\n }\n\n getIsAtDefault() {\n return this.storage.isAtDefault;\n }\n\n /**\n * Passes a JSON-compatible structure to `adapter.persist`\n *\n * This structure could be stored in a remote database or\n * local storage. The `adpater.restore` method can be used to restore\n * this structure back in to the {@link TrackedPreferences }\n */\n persist() {\n return this.adapter?.persist?.(this.key, {\n ...this.storage.serialize(),\n });\n }\n\n /**\n * Using the `adapter.restore` method, convert the JSON structure\n * to {@link TrackedPreferences }\n */\n restore(adapter: Adapter) {\n let data = adapter?.restore?.(this.key);\n\n if (!data) return;\n\n return this.storage.restore(data);\n }\n}\n\n/**\n * @public\n *\n * The API for reactively interacting with preferences\n */\nclass TrackedPreferences {\n plugins = new Map<string, TrackedPluginPrefs>();\n\n get isAtDefault(): boolean {\n return [...this.plugins.values()].every((pluginPrefs) => pluginPrefs.isAtDefault);\n }\n\n forPlugin(name: string) {\n let existing = this.plugins.get(name);\n\n if (!existing) {\n existing = new TrackedPluginPrefs();\n this.plugins.set(name, existing);\n }\n\n return existing;\n }\n\n serialize(): TablePreferencesData {\n let plugins: TablePreferencesData['plugins'] = {};\n\n for (let [pluginName, preferences] of this.plugins.entries()) {\n /**\n * This cast is dirty, and should be fixed eventually.\n * We should be able to, knowing that pluginName\n * will either be in the registry, or be a default PluginPreferences\n * object, that we can assign the serialized structure to plugins.\n */\n (plugins as any)[pluginName] = preferences.serialize();\n }\n\n return {\n plugins,\n };\n }\n\n restore(data: TablePreferencesData): void {\n let { plugins } = data;\n\n for (let [pluginName, preferences] of Object.entries(plugins || {})) {\n let trackedPluginPrefs = new TrackedPluginPrefs();\n\n trackedPluginPrefs.restore(preferences);\n\n this.plugins.set(pluginName, trackedPluginPrefs);\n }\n }\n}\n\nclass TrackedPluginPrefs<PluginName = unknown> {\n table = new TrackedMap<string, unknown>();\n columns = new Map<string, TrackedMap<string, unknown>>();\n\n get isAtDefault(): boolean {\n return this.table.size === 0 && [...this.columns.values()].every((x) => x.size === 0);\n }\n\n forColumn = (key: string): TrackedMap<string, unknown> => {\n let existing = this.columns.get(key);\n\n if (!existing) {\n existing = new TrackedMap();\n this.columns.set(key, existing);\n }\n\n return existing;\n };\n\n serialize(): PluginPreferenceFor<PluginName> {\n let columnsPrefs: PluginPreferences['columns'] = {};\n let tablePrefs: PluginPreferences['table'] = {};\n\n for (let [columnKey, preferences] of this.columns.entries()) {\n let serializedPreferences: Record<string, unknown> = {};\n\n for (let [key, preference] of preferences.entries()) {\n serializedPreferences[key] = preference;\n }\n\n columnsPrefs[columnKey] = serializedPreferences;\n }\n\n for (let [key, preference] of this.table.entries()) {\n tablePrefs[key] = preference;\n }\n\n return {\n table: tablePrefs,\n columns: columnsPrefs,\n } as PluginPreferenceFor<PluginName>;\n }\n\n restore(data: PluginPreferences): void {\n let { table, columns } = data;\n\n for (let [key, preferences] of Object.entries(columns)) {\n let trackedPluginPrefs = new TrackedMap(Object.entries(preferences));\n\n this.columns.set(key, trackedPluginPrefs);\n }\n\n /**\n * TODO: fix the inference here...\n * each time there is a cast, there is a greater risk of runtime error.\n */\n this.table = new TrackedMap<string, PreferencesTableValues<PluginName>>(\n Object.entries(table) as [string, PreferencesTableValues<PluginName>][]\n );\n }\n}\n"],"names":["TablePreferences","constructor","key","adapter","TrackedPreferences","restore","hasAdapter","undefined","getIsAtDefault","storage","isAtDefault","persist","serialize","data","Map","plugins","values","every","pluginPrefs","forPlugin","name","existing","get","TrackedPluginPrefs","set","pluginName","preferences","entries","Object","trackedPluginPrefs","TrackedMap","columns","table","size","x","columnsPrefs","tablePrefs","columnKey","serializedPreferences","preference"],"mappings":";;;AAUO,MAAMA,gBAAgB,CAAC;AAG5BC,EAAAA,
|
1
|
+
{"version":3,"file":"preferences.js","sources":["../../src/-private/preferences.ts"],"sourcesContent":["import { TrackedMap } from 'tracked-built-ins';\n\nimport type {\n PluginPreferenceFor,\n PluginPreferences,\n PreferencesAdapter as Adapter,\n PreferencesTableValues,\n TablePreferencesData,\n} from '#interfaces';\n\nexport class TablePreferences {\n storage = new TrackedPreferences();\n\n constructor(private key: string, private adapter?: Adapter) {\n if (this.adapter) {\n this.restore(this.adapter);\n }\n }\n\n hasAdapter() {\n return this.adapter !== undefined;\n }\n\n getIsAtDefault() {\n return this.storage.isAtDefault;\n }\n\n /**\n * Passes a JSON-compatible structure to `adapter.persist`\n *\n * This structure could be stored in a remote database or\n * local storage. The `adpater.restore` method can be used to restore\n * this structure back in to the {@link TrackedPreferences }\n */\n persist() {\n return this.adapter?.persist?.(this.key, {\n ...this.storage.serialize(),\n });\n }\n\n /**\n * Using the `adapter.restore` method, convert the JSON structure\n * to {@link TrackedPreferences }\n */\n restore(adapter: Adapter) {\n let data = adapter?.restore?.(this.key);\n\n if (!data) return;\n\n return this.storage.restore(data);\n }\n}\n\n/**\n * @public\n *\n * The API for reactively interacting with preferences\n */\nclass TrackedPreferences {\n plugins = new Map<string, TrackedPluginPrefs>();\n\n get isAtDefault(): boolean {\n return [...this.plugins.values()].every((pluginPrefs) => pluginPrefs.isAtDefault);\n }\n\n forPlugin(name: string) {\n let existing = this.plugins.get(name);\n\n if (!existing) {\n existing = new TrackedPluginPrefs();\n this.plugins.set(name, existing);\n }\n\n return existing;\n }\n\n serialize(): TablePreferencesData {\n let plugins: TablePreferencesData['plugins'] = {};\n\n for (let [pluginName, preferences] of this.plugins.entries()) {\n /**\n * This cast is dirty, and should be fixed eventually.\n * We should be able to, knowing that pluginName\n * will either be in the registry, or be a default PluginPreferences\n * object, that we can assign the serialized structure to plugins.\n */\n (plugins as any)[pluginName] = preferences.serialize();\n }\n\n return {\n plugins,\n };\n }\n\n restore(data: TablePreferencesData): void {\n let { plugins } = data;\n\n for (let [pluginName, preferences] of Object.entries(plugins || {})) {\n let trackedPluginPrefs = new TrackedPluginPrefs();\n\n trackedPluginPrefs.restore(preferences);\n\n this.plugins.set(pluginName, trackedPluginPrefs);\n }\n }\n}\n\nclass TrackedPluginPrefs<PluginName = unknown> {\n table = new TrackedMap<string, unknown>();\n columns = new Map<string, TrackedMap<string, unknown>>();\n\n get isAtDefault(): boolean {\n return this.table.size === 0 && [...this.columns.values()].every((x) => x.size === 0);\n }\n\n forColumn = (key: string): TrackedMap<string, unknown> => {\n let existing = this.columns.get(key);\n\n if (!existing) {\n existing = new TrackedMap();\n this.columns.set(key, existing);\n }\n\n return existing;\n };\n\n serialize(): PluginPreferenceFor<PluginName> {\n let columnsPrefs: PluginPreferences['columns'] = {};\n let tablePrefs: PluginPreferences['table'] = {};\n\n for (let [columnKey, preferences] of this.columns.entries()) {\n let serializedPreferences: Record<string, unknown> = {};\n\n for (let [key, preference] of preferences.entries()) {\n serializedPreferences[key] = preference;\n }\n\n columnsPrefs[columnKey] = serializedPreferences;\n }\n\n for (let [key, preference] of this.table.entries()) {\n tablePrefs[key] = preference;\n }\n\n return {\n table: tablePrefs,\n columns: columnsPrefs,\n } as PluginPreferenceFor<PluginName>;\n }\n\n restore(data: PluginPreferences): void {\n let { table, columns } = data;\n\n for (let [key, preferences] of Object.entries(columns)) {\n let trackedPluginPrefs = new TrackedMap(Object.entries(preferences));\n\n this.columns.set(key, trackedPluginPrefs);\n }\n\n /**\n * TODO: fix the inference here...\n * each time there is a cast, there is a greater risk of runtime error.\n */\n this.table = new TrackedMap<string, PreferencesTableValues<PluginName>>(\n Object.entries(table) as [string, PreferencesTableValues<PluginName>][]\n );\n }\n}\n"],"names":["TablePreferences","constructor","key","adapter","_defineProperty","TrackedPreferences","restore","hasAdapter","undefined","getIsAtDefault","storage","isAtDefault","persist","serialize","data","Map","plugins","values","every","pluginPrefs","forPlugin","name","existing","get","TrackedPluginPrefs","set","pluginName","preferences","entries","Object","trackedPluginPrefs","TrackedMap","columns","table","size","x","columnsPrefs","tablePrefs","columnKey","serializedPreferences","preference"],"mappings":";;;AAUO,MAAMA,gBAAgB,CAAC;AAG5BC,EAAAA,WAAWA,CAASC,GAAW,EAAUC,OAAiB,EAAE;IAAAC,eAAA,CAAA,IAAA,EAAA,SAAA,EAFlD,IAAIC,kBAAkB,EAAE,CAAA,CAAA;IAAA,IAEdH,CAAAA,GAAW,GAAXA,GAAW,CAAA;IAAA,IAAUC,CAAAA,OAAiB,GAAjBA,OAAiB,CAAA;IACxD,IAAI,IAAI,CAACA,OAAO,EAAE;AAChB,MAAA,IAAI,CAACG,OAAO,CAAC,IAAI,CAACH,OAAO,CAAC,CAAA;AAC5B,KAAA;AACF,GAAA;AAEAI,EAAAA,UAAUA,GAAG;AACX,IAAA,OAAO,IAAI,CAACJ,OAAO,KAAKK,SAAS,CAAA;AACnC,GAAA;AAEAC,EAAAA,cAAcA,GAAG;AACf,IAAA,OAAO,IAAI,CAACC,OAAO,CAACC,WAAW,CAAA;AACjC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,OAAOA,GAAG;IACR,OAAO,IAAI,CAACT,OAAO,EAAES,OAAO,GAAG,IAAI,CAACV,GAAG,EAAE;AACvC,MAAA,GAAG,IAAI,CAACQ,OAAO,CAACG,SAAS,EAAA;AAC3B,KAAC,CAAC,CAAA;AACJ,GAAA;;AAEA;AACF;AACA;AACA;EACEP,OAAOA,CAACH,OAAgB,EAAE;IACxB,IA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IAAI,CAACG,KAAK,GAAG,IAAIF,UAAU,CACzBF,MAAM,CAACD,OAAO,CAACK,KAAK,CAAC,CACtB,CAAA;AACH,GAAA;AACF;;;;"}
|
package/dist/-private/row.d.ts
CHANGED
package/dist/-private/row.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as _defineProperty } from '../defineProperty-
|
1
|
+
import { _ as _defineProperty } from '../defineProperty-4f0781e1.js';
|
2
2
|
import { _ as _applyDecoratedDescriptor } from '../applyDecoratedDescriptor-6b986a67.js';
|
3
3
|
import { assert } from '@ember/debug';
|
4
4
|
import { action } from '@ember/object';
|
package/dist/-private/row.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"row.js","sources":["../../src/-private/row.ts"],"sourcesContent":["import { assert } from '@ember/debug';\nimport { action } from '@ember/object';\n\nimport type { Table } from './table';\n\nexport class Row<DataType = Record<string, unknown>> {\n data: DataType;\n table: Table<DataType>;\n\n get index(): number {\n let i = this.table.rows.values().indexOf(this);\n\n assert(`Row is no longer a part of the table, something has gone wrong`, i >= 0);\n\n return i;\n }\n\n get isOdd() {\n return this.index % 2 !== 0;\n }\n\n get next(): Row<DataType> | undefined {\n return this.table.rows[this.index + 1];\n }\n\n get prev(): Row<DataType> | undefined {\n return this.table.rows[this.index - 1];\n }\n\n constructor(table: Table<DataType>, data: DataType) {\n this.data = data;\n this.table = table;\n }\n\n @action\n handleClick(event: MouseEvent) {\n assert(\n `expected event.target to be an instance of HTMLElement`,\n event.target instanceof HTMLElement || event.target instanceof SVGElement\n );\n\n let selection = document.getSelection();\n\n if (selection) {\n let { type, anchorNode } = selection;\n let isSelectingText = type === 'Range' && event.target?.contains(anchorNode);\n\n if (isSelectingText) {\n event.stopPropagation();\n\n return;\n }\n }\n\n // Ignore clicks on interactive elements within the row\n let inputParent = event.target.closest('input, button, label, a, select');\n\n if (inputParent) {\n return;\n }\n }\n}\n"],"names":["Row","index","i","table","rows","values","indexOf","assert","isOdd","next","prev","constructor","data","handleClick","event","target","HTMLElement","SVGElement","selection","document","getSelection","type","anchorNode","isSelectingText","contains","stopPropagation","inputParent","closest","action"],"mappings":";;;;;;AAKA,IAAaA,GAAG,
|
1
|
+
{"version":3,"file":"row.js","sources":["../../src/-private/row.ts"],"sourcesContent":["import { assert } from '@ember/debug';\nimport { action } from '@ember/object';\n\nimport type { Table } from './table';\n\nexport class Row<DataType = Record<string, unknown>> {\n data: DataType;\n table: Table<DataType>;\n\n get index(): number {\n let i = this.table.rows.values().indexOf(this);\n\n assert(`Row is no longer a part of the table, something has gone wrong`, i >= 0);\n\n return i;\n }\n\n get isOdd() {\n return this.index % 2 !== 0;\n }\n\n get next(): Row<DataType> | undefined {\n return this.table.rows[this.index + 1];\n }\n\n get prev(): Row<DataType> | undefined {\n return this.table.rows[this.index - 1];\n }\n\n constructor(table: Table<DataType>, data: DataType) {\n this.data = data;\n this.table = table;\n }\n\n @action\n handleClick(event: MouseEvent) {\n assert(\n `expected event.target to be an instance of HTMLElement`,\n event.target instanceof HTMLElement || event.target instanceof SVGElement\n );\n\n let selection = document.getSelection();\n\n if (selection) {\n let { type, anchorNode } = selection;\n let isSelectingText = type === 'Range' && event.target?.contains(anchorNode);\n\n if (isSelectingText) {\n event.stopPropagation();\n\n return;\n }\n }\n\n // Ignore clicks on interactive elements within the row\n let inputParent = event.target.closest('input, button, label, a, select');\n\n if (inputParent) {\n return;\n }\n }\n}\n"],"names":["Row","_class","index","i","table","rows","values","indexOf","assert","isOdd","next","prev","constructor","data","_defineProperty","handleClick","event","target","HTMLElement","SVGElement","selection","document","getSelection","type","anchorNode","isSelectingText","contains","stopPropagation","inputParent","closest","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;AAKA,IAAaA,GAAG,IAAAC,MAAA,GAAT,MAAMD,GAAG,CAAqC;EAInD,IAAIE,KAAKA,GAAW;AAClB,IAAA,IAAIC,CAAC,GAAG,IAAI,CAACC,KAAK,CAACC,IAAI,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AAIP,KAAK,CAACC,MAAM,EAAES,QAAQ,CAACF,UAAU,CAAC,CAAA;AAE5E,MAAA,IAAIC,eAAe,EAAE;QACnBT,KAAK,CAACW,eAAe,EAAE,CAAA;AAEvB,QAAA,OAAA;AACF,OAAA;AACF,KAAA;;AAEA;IACA,IAAIC,WAAW,GAAGZ,KAAK,CAACC,MAAM,CAACY,OAAO,CAAC,iCAAiC,CAAC,CAAA;AAEzE,IAAA,IAAID,WAAW,EAAE;AACf,MAAA,OAAA;AACF,KAAA;AACF,GAAA;AACF,CAAC,GAAAE,yBAAA,CAAA7B,MAAA,CAAA8B,SAAA,EAAA,aAAA,EAAA,CA3BEC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAjC,MAAA,CAAA8B,SAAA,kBAAA9B,MAAA,CAAA8B,SAAA,CAAA,GAAA9B,MAAA;;;;"}
|
package/dist/-private/table.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export { C as COLUMN_META_KEY, R as ROW_META_KEY,
|
2
|
-
import '../defineProperty-
|
1
|
+
export { C as COLUMN_META_KEY, R as ROW_META_KEY, b as TABLE_KEY, a as TABLE_META_KEY, T as Table } from '../table-443deac1.js';
|
2
|
+
import '../defineProperty-4f0781e1.js';
|
3
3
|
import '../applyDecoratedDescriptor-6b986a67.js';
|
4
4
|
import '@glimmer/tracking';
|
5
5
|
import '@ember/application';
|
package/dist/-private/utils.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { FunctionModifier } from "./interfaces/index";
|
1
|
+
import { FunctionModifier } from "./interfaces/index.js";
|
2
2
|
declare function composeFunctionModifiers<Args extends unknown[]>(modifiers: Array<FunctionModifier<Args> | undefined>): (element: HTMLElement, ...args: Args) => () => void;
|
3
3
|
export { composeFunctionModifiers };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/-private/utils.ts"],"sourcesContent":["import type { Destructor, FunctionModifier } from '#interfaces';\n\nexport function composeFunctionModifiers<Args extends unknown[]>(\n modifiers: Array<FunctionModifier<Args> | undefined>\n) {\n let setup = modifiers.filter(Boolean) as FunctionModifier<Args>[];\n\n let composed = (element: HTMLElement, ...args: Args) => {\n let destructors = setup.map((fn) => fn(element, ...args)).filter(Boolean) as Destructor[];\n\n return () => {\n for (let destructor of destructors) {\n destructor();\n }\n };\n };\n\n return composed;\n}\n"],"names":["composeFunctionModifiers","modifiers","setup","filter","Boolean","composed","element","args","destructors","map","fn","destructor"],"mappings":"AAEO,SAASA,
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/-private/utils.ts"],"sourcesContent":["import type { Destructor, FunctionModifier } from '#interfaces';\n\nexport function composeFunctionModifiers<Args extends unknown[]>(\n modifiers: Array<FunctionModifier<Args> | undefined>\n) {\n let setup = modifiers.filter(Boolean) as FunctionModifier<Args>[];\n\n let composed = (element: HTMLElement, ...args: Args) => {\n let destructors = setup.map((fn) => fn(element, ...args)).filter(Boolean) as Destructor[];\n\n return () => {\n for (let destructor of destructors) {\n destructor();\n }\n };\n };\n\n return composed;\n}\n"],"names":["composeFunctionModifiers","modifiers","setup","filter","Boolean","composed","element","args","destructors","map","fn","destructor"],"mappings":"AAEO,SAASA,wBAAwBA,CACtCC,SAAoD,EACpD;AACA,EAAA,IAAIC,KAAK,GAAGD,SAAS,CAACE,MAAM,CAACC,OAAO,CAA6B,CAAA;AAEjE,EAAA,IAAIC,QAAQ,GAAGA,CAACC,OAAoB,EAAE,GAAGC,IAAU,KAAK;IACtD,IAAIC,WAAW,GAAGN,KAAK,CAACO,GAAG,CAAEC,EAAE,IAAKA,EAAE,CAACJ,OAAO,EAAE,GAAGC,IAAI,CAAC,CAAC,CAACJ,MAAM,CAACC,OAAO,CAAiB,CAAA;AAEzF,IAAA,OAAO,MAAM;AACX,MAAA,KAAK,IAAIO,UAAU,IAAIH,WAAW,EAAE;AAClCG,QAAAA,UAAU,EAAE,CAAA;AACd,OAAA;KACD,CAAA;GACF,CAAA;AAED,EAAA,OAAON,QAAQ,CAAA;AACjB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"applyDecoratedDescriptor-6b986a67.js","sources":["../../node_modules/.pnpm/@babel+runtime@7.
|
1
|
+
{"version":3,"file":"applyDecoratedDescriptor-6b986a67.js","sources":["../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js"],"sourcesContent":["export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n return desc;\n}"],"names":["_applyDecoratedDescriptor","target","property","decorators","descriptor","context","desc","Object","keys","forEach","key","enumerable","configurable","initializer","writable","slice","reverse","reduce","decorator","value","call","undefined","defineProperty"],"mappings":"AAAe,SAASA,yBAAyBA,CAACC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,OAAO,EAAE;EACnG,IAAIC,IAAI,GAAG,EAAE,CAAA;EACbC,MAAM,CAACC,IAAI,CAACJ,UAAU,CAAC,CAACK,OAAO,CAAC,UAAUC,GAAG,EAAE;AAC7CJ,IAAAA,IAAI,CAACI,GAAG,CAAC,GAAGN,UAAU,CAACM,GAAG,CAAC,CAAA;AAC7B,GAAC,CAAC,CAAA;AACFJ,EAAAA,IAAI,CAACK,UAAU,GAAG,CAAC,CAACL,IAAI,CAACK,UAAU,CAAA;AACnCL,EAAAA,IAAI,CAACM,YAAY,GAAG,CAAC,CAACN,IAAI,CAACM,YAAY,CAAA;AACvC,EAAA,IAAI,OAAO,IAAIN,IAAI,IAAIA,IAAI,CAACO,WAAW,EAAE;IACvCP,IAAI,CAACQ,QAAQ,GAAG,IAAI,CAAA;AACtB,GAAA;AACAR,EAAAA,IAAI,GAAGH,UAAU,CAACY,KAAK,EAAE,CAACC,OAAO,EAAE,CAACC,MAAM,CAAC,UAAUX,IAAI,EAAEY,SAAS,EAAE;IACpE,OAAOA,SAAS,CAACjB,MAAM,EAAEC,QAAQ,EAAEI,IAAI,CAAC,IAAIA,IAAI,CAAA;GACjD,EAAEA,IAAI,CAAC,CAAA;EACR,IAAID,OAAO,IAAIC,IAAI,CAACO,WAAW,KAAK,KAAK,CAAC,EAAE;AAC1CP,IAAAA,IAAI,CAACa,KAAK,GAAGb,IAAI,CAACO,WAAW,GAAGP,IAAI,CAACO,WAAW,CAACO,IAAI,CAACf,OAAO,CAAC,GAAG,KAAK,CAAC,CAAA;IACvEC,IAAI,CAACO,WAAW,GAAGQ,SAAS,CAAA;AAC9B,GAAA;AACA,EAAA,IAAIf,IAAI,CAACO,WAAW,KAAK,KAAK,CAAC,EAAE;IAC/BN,MAAM,CAACe,cAAc,CAACrB,MAAM,EAAEC,QAAQ,EAAEI,IAAI,CAAC,CAAA;AAC7CA,IAAAA,IAAI,GAAG,IAAI,CAAA;AACb,GAAA;AACA,EAAA,OAAOA,IAAI,CAAA;AACb;;;;","x_google_ignoreList":[0]}
|
@@ -17,5 +17,5 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
17
17
|
return _classApplyDescriptorGet(receiver, descriptor);
|
18
18
|
}
|
19
19
|
|
20
|
-
export {
|
21
|
-
//# sourceMappingURL=classPrivateFieldGet-
|
20
|
+
export { _classPrivateFieldGet as _, _classExtractFieldDescriptor as a };
|
21
|
+
//# sourceMappingURL=classPrivateFieldGet-0bfc0262.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"classPrivateFieldGet-
|
1
|
+
{"version":3,"file":"classPrivateFieldGet-0bfc0262.js","sources":["../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js","../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js","../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js"],"sourcesContent":["export default function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n return privateMap.get(receiver);\n}","export default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n}","import classApplyDescriptorGet from \"./classApplyDescriptorGet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}"],"names":["_classExtractFieldDescriptor","receiver","privateMap","action","has","TypeError","get","_classApplyDescriptorGet","descriptor","call","value","_classPrivateFieldGet","classExtractFieldDescriptor","classApplyDescriptorGet"],"mappings":"AAAe,SAASA,4BAA4BA,CAACC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,EAAE;AACjF,EAAA,IAAI,CAACD,UAAU,CAACE,GAAG,CAACH,QAAQ,CAAC,EAAE;IAC7B,MAAM,IAAII,SAAS,CAAC,eAAe,GAAGF,MAAM,GAAG,gCAAgC,CAAC,CAAA;AAClF,GAAA;AACA,EAAA,OAAOD,UAAU,CAACI,GAAG,CAACL,QAAQ,CAAC,CAAA;AACjC;;ACLe,SAASM,wBAAwBA,CAACN,QAAQ,EAAEO,UAAU,EAAE;EACrE,IAAIA,UAAU,CAACF,GAAG,EAAE;AAClB,IAAA,OAAOE,UAAU,CAACF,GAAG,CAACG,IAAI,CAACR,QAAQ,CAAC,CAAA;AACtC,GAAA;EACA,OAAOO,UAAU,CAACE,KAAK,CAAA;AACzB;;ACHe,SAASC,qBAAqBA,CAACV,QAAQ,EAAEC,UAAU,EAAE;EAClE,IAAIM,UAAU,GAAGI,4BAA2B,CAACX,QAAQ,EAAEC,UAAU,EAAE,KAAK,CAAC,CAAA;AACzE,EAAA,OAAOW,wBAAuB,CAACZ,QAAQ,EAAEO,UAAU,CAAC,CAAA;AACtD;;;;","x_google_ignoreList":[0,1,2]}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
function _typeof(obj) {
|
2
|
+
"@babel/helpers - typeof";
|
3
|
+
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
5
|
+
return typeof obj;
|
6
|
+
} : function (obj) {
|
7
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
8
|
+
}, _typeof(obj);
|
9
|
+
}
|
10
|
+
|
11
|
+
function _toPrimitive(input, hint) {
|
12
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
13
|
+
var prim = input[Symbol.toPrimitive];
|
14
|
+
if (prim !== undefined) {
|
15
|
+
var res = prim.call(input, hint || "default");
|
16
|
+
if (_typeof(res) !== "object") return res;
|
17
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
18
|
+
}
|
19
|
+
return (hint === "string" ? String : Number)(input);
|
20
|
+
}
|
21
|
+
|
22
|
+
function _toPropertyKey(arg) {
|
23
|
+
var key = _toPrimitive(arg, "string");
|
24
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
25
|
+
}
|
26
|
+
|
27
|
+
function _defineProperty(obj, key, value) {
|
28
|
+
key = _toPropertyKey(key);
|
29
|
+
if (key in obj) {
|
30
|
+
Object.defineProperty(obj, key, {
|
31
|
+
value: value,
|
32
|
+
enumerable: true,
|
33
|
+
configurable: true,
|
34
|
+
writable: true
|
35
|
+
});
|
36
|
+
} else {
|
37
|
+
obj[key] = value;
|
38
|
+
}
|
39
|
+
return obj;
|
40
|
+
}
|
41
|
+
|
42
|
+
export { _defineProperty as _ };
|
43
|
+
//# sourceMappingURL=defineProperty-4f0781e1.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"defineProperty-4f0781e1.js","sources":["../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/.pnpm/@babel+runtime@7.21.0/node_modules/@babel/runtime/helpers/esm/defineProperty.js"],"sourcesContent":["export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","_toPrimitive","input","hint","prim","toPrimitive","undefined","res","call","TypeError","String","Number","_toPropertyKey","arg","key","_defineProperty","value","toPropertyKey","Object","defineProperty","enumerable","configurable","writable"],"mappings":"AAAe,SAASA,OAAOA,CAACC,GAAG,EAAE;EACnC,yBAAyB,CAAA;;AAEzB,EAAA,OAAOD,OAAO,GAAG,UAAU,IAAI,OAAOE,MAAM,IAAI,QAAQ,IAAI,OAAOA,MAAM,CAACC,QAAQ,GAAG,UAAUF,GAAG,EAAE;AAClG,IAAA,OAAO,OAAOA,GAAG,CAAA;GAClB,GAAG,UAAUA,GAAG,EAAE;IACjB,OAAOA,GAAG,IAAI,UAAU,IAAI,OAAOC,MAAM,IAAID,GAAG,CAACG,WAAW,KAAKF,MAAM,IAAID,GAAG,KAAKC,MAAM,CAACG,SAAS,GAAG,QAAQ,GAAG,OAAOJ,GAAG,CAAA;AAC7H,GAAC,EAAED,OAAO,CAACC,GAAG,CAAC,CAAA;AACjB;;ACPe,SAASK,YAAYA,CAACC,KAAK,EAAEC,IAAI,EAAE;AAChD,EAAA,IAAIR,OAAO,CAACO,KAAK,CAAC,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE,OAAOA,KAAK,CAAA;AAC/D,EAAA,IAAIE,IAAI,GAAGF,KAAK,CAACL,MAAM,CAACQ,WAAW,CAAC,CAAA;EACpC,IAAID,IAAI,KAAKE,SAAS,EAAE;IACtB,IAAIC,GAAG,GAAGH,IAAI,CAACI,IAAI,CAACN,KAAK,EAAEC,IAAI,IAAI,SAAS,CAAC,CAAA;IAC7C,IAAIR,OAAO,CAACY,GAAG,CAAC,KAAK,QAAQ,EAAE,OAAOA,GAAG,CAAA;AACzC,IAAA,MAAM,IAAIE,SAAS,CAAC,8CAA8C,CAAC,CAAA;AACrE,GAAA;EACA,OAAO,CAACN,IAAI,KAAK,QAAQ,GAAGO,MAAM,GAAGC,MAAM,EAAET,KAAK,CAAC,CAAA;AACrD;;ACRe,SAASU,cAAcA,CAACC,GAAG,EAAE;AAC1C,EAAA,IAAIC,GAAG,GAAGT,YAAW,CAACQ,GAAG,EAAE,QAAQ,CAAC,CAAA;AACpC,EAAA,OAAOlB,OAAO,CAACmB,GAAG,CAAC,KAAK,QAAQ,GAAGA,GAAG,GAAGJ,MAAM,CAACI,GAAG,CAAC,CAAA;AACtD;;ACJe,SAASC,eAAeA,CAACnB,GAAG,EAAEkB,GAAG,EAAEE,KAAK,EAAE;AACvDF,EAAAA,GAAG,GAAGG,cAAa,CAACH,GAAG,CAAC,CAAA;EACxB,IAAIA,GAAG,IAAIlB,GAAG,EAAE;AACdsB,IAAAA,MAAM,CAACC,cAAc,CAACvB,GAAG,EAAEkB,GAAG,EAAE;AAC9BE,MAAAA,KAAK,EAAEA,KAAK;AACZI,MAAAA,UAAU,EAAE,IAAI;AAChBC,MAAAA,YAAY,EAAE,IAAI;AAClBC,MAAAA,QAAQ,EAAE,IAAA;AACZ,KAAC,CAAC,CAAA;AACJ,GAAC,MAAM;AACL1B,IAAAA,GAAG,CAACkB,GAAG,CAAC,GAAGE,KAAK,CAAA;AAClB,GAAA;AACA,EAAA,OAAOpB,GAAG,CAAA;AACZ;;;;","x_google_ignoreList":[0,1,2,3]}
|
package/dist/index.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
/********************************
|
2
2
|
* Public API
|
3
3
|
*******************************/
|
4
|
-
export { headlessTable } from "./-private/js-helper";
|
5
|
-
export { TablePreferences } from "./-private/preferences";
|
6
|
-
export { deserializeSorts, serializeSorts } from "./utils";
|
4
|
+
export { headlessTable } from "./-private/js-helper.js";
|
5
|
+
export { TablePreferences } from "./-private/preferences.js";
|
6
|
+
export { deserializeSorts, serializeSorts } from "./utils.js";
|
7
7
|
/********************************
|
8
8
|
* Public Types
|
9
9
|
*******************************/
|
10
|
-
export type { Column } from "./-private/column";
|
11
|
-
export type { ColumnConfig, ColumnKey, Pagination, PreferencesAdapter, TablePreferencesData as PreferencesData, Selection, TableConfig, TableMeta } from "./-private/interfaces/index";
|
12
|
-
export type { Row } from "./-private/row";
|
13
|
-
export type { Table } from "./table-
|
10
|
+
export type { Column } from "./-private/column.js";
|
11
|
+
export type { ColumnConfig, ColumnKey, Pagination, PreferencesAdapter, TablePreferencesData as PreferencesData, Selection, TableConfig, TableMeta } from "./-private/interfaces/index.js";
|
12
|
+
export type { Row } from "./-private/row.js";
|
13
|
+
export type { Table } from "./table-443deac1.js";
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { Table } from "../../table-
|
2
|
-
import { ColumnReordering } from "../column-reordering/index";
|
3
|
-
import { ColumnVisibility } from "../column-visibility/index";
|
4
|
-
import { Class, Constructor } from "../../-private/private-types";
|
5
|
-
import { Column, Row } from "../../index";
|
6
|
-
import { ColumnMetaFor, ColumnOptionsFor, OptionsFor, Plugin, RowMetaFor, TableMetaFor } from "../../-private/interfaces/index";
|
1
|
+
import { Table } from "../../table-443deac1.js";
|
2
|
+
import { ColumnReordering } from "../column-reordering/index.js";
|
3
|
+
import { ColumnVisibility } from "../column-visibility/index.js";
|
4
|
+
import { Class, Constructor } from "../../-private/private-types.js";
|
5
|
+
import { Column, Row } from "../../index.js";
|
6
|
+
import { ColumnMetaFor, ColumnOptionsFor, OptionsFor, Plugin, RowMetaFor, TableMetaFor } from "../../-private/interfaces/index.js";
|
7
7
|
type InstanceOf<T> = T extends Class<infer Instance> ? Instance : T;
|
8
8
|
/**
|
9
9
|
* @public
|