@framesquared/ui 0.1.0 → 0.2.0

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/index.d.ts CHANGED
@@ -888,15 +888,15 @@ type ElbowType = 'line' | 'empty' | 'end' | 'end-plus' | 'tee' | 'tee-plus';
888
888
  interface EditorConfig {
889
889
  xtype: string;
890
890
  /** options for combobox/select/radiogroup — array of {value,text} or plain strings */
891
- options?: Array<{
891
+ options?: ({
892
892
  value: string;
893
893
  text: string;
894
- } | string>;
894
+ } | string)[];
895
895
  /** legacy: ExtJS-style store for combobox */
896
- store?: Array<{
896
+ store?: ({
897
897
  value: string;
898
898
  text: string;
899
- } | string>;
899
+ } | string)[];
900
900
  displayField?: string;
901
901
  valueField?: string;
902
902
  minValue?: number;
@@ -998,8 +998,8 @@ declare class TreeGridView {
998
998
  private focusedNode;
999
999
  private _rowCache;
1000
1000
  constructor(config: TreeGridViewConfig);
1001
- on(event: string, fn: Function): void;
1002
- un(event: string, fn: Function): void;
1001
+ on(event: string, fn: (...args: any[]) => void): void;
1002
+ un(event: string, fn: (...args: any[]) => void): void;
1003
1003
  private fireEvent;
1004
1004
  render(container: HTMLElement): void;
1005
1005
  refresh(): void;
@@ -1052,8 +1052,8 @@ declare class TreeGridSelectionModel {
1052
1052
  readonly checkboxSelect: boolean;
1053
1053
  private anchor;
1054
1054
  constructor(config?: TreeGridSelectionModelConfig);
1055
- on(event: string, fn: Function): void;
1056
- un(event: string, fn: Function): void;
1055
+ on(event: string, fn: (...args: any[]) => void): void;
1056
+ un(event: string, fn: (...args: any[]) => void): void;
1057
1057
  private fireEvent;
1058
1058
  select(nodes: NodeInterface | NodeInterface[], keepExisting?: boolean, suppressEvent?: boolean): void;
1059
1059
  deselect(nodes: NodeInterface | NodeInterface[], suppressEvent?: boolean): void;
@@ -1577,7 +1577,7 @@ interface ExportOptions {
1577
1577
  filename?: string;
1578
1578
  }
1579
1579
  declare class TreeGridExporter {
1580
- constructor(_options?: ExportOptions);
1580
+ constructor(_options?: Record<string, unknown>);
1581
1581
  /**
1582
1582
  * Exports the TreeGrid to CSV format.
1583
1583
  */
@@ -1649,8 +1649,8 @@ declare class TreeView {
1649
1649
  private column;
1650
1650
  private listeners;
1651
1651
  constructor(config: TreeViewConfig);
1652
- on(event: string, fn: Function): void;
1653
- un(event: string, fn: Function): void;
1652
+ on(event: string, fn: (...args: any[]) => void): void;
1653
+ un(event: string, fn: (...args: any[]) => void): void;
1654
1654
  private fireEvent;
1655
1655
  render(container: HTMLElement): void;
1656
1656
  refresh(): void;
@@ -1695,7 +1695,6 @@ declare class TreePanel extends Panel {
1695
1695
  private _singleExpand;
1696
1696
  private _checkable;
1697
1697
  private _cascadeChecks;
1698
- constructor(config: TreePanelConfig);
1699
1698
  protected initialize(): void;
1700
1699
  protected afterRender(): void;
1701
1700
  getStore(): TreeStore;
@@ -1731,8 +1730,8 @@ declare class TreeSelectionModel {
1731
1730
  private pruneRemoved;
1732
1731
  private listeners;
1733
1732
  constructor(config?: TreeSelectionModelConfig);
1734
- on(event: string, fn: Function): void;
1735
- un(event: string, fn: Function): void;
1733
+ on(event: string, fn: (...args: any[]) => void): void;
1734
+ un(event: string, fn: (...args: any[]) => void): void;
1736
1735
  fireEvent(event: string, ...args: unknown[]): void;
1737
1736
  select(records: NodeInterface | NodeInterface[], keepExisting?: boolean, suppressEvent?: boolean): void;
1738
1737
  deselect(records: NodeInterface | NodeInterface[], suppressEvent?: boolean): void;
@@ -1827,8 +1826,8 @@ declare class TreeDropZone {
1827
1826
  private boundDrop;
1828
1827
  constructor(tree: TreePanelLike & {
1829
1828
  getStore(): {
1830
- insertBefore: Function;
1831
- appendChild: Function;
1829
+ insertBefore: (...args: unknown[]) => void;
1830
+ appendChild: (...args: unknown[]) => void;
1832
1831
  };
1833
1832
  }, config?: {
1834
1833
  ddGroup?: string;
@@ -1863,8 +1862,8 @@ interface TreeViewDragDropConfig {
1863
1862
  }
1864
1863
  type FullTreePanel = TreePanelLike & {
1865
1864
  getStore(): {
1866
- insertBefore: Function;
1867
- appendChild: Function;
1865
+ insertBefore: (...args: unknown[]) => void;
1866
+ appendChild: (...args: unknown[]) => void;
1868
1867
  };
1869
1868
  };
1870
1869
  declare class TreeViewDragDrop {
@@ -1889,7 +1888,7 @@ interface CellEditingConfig {
1889
1888
  }
1890
1889
  /** Minimal interface CellEditingPlugin needs from TreePanel */
1891
1890
  interface CellEditingTreePanel {
1892
- on(event: string, fn: Function): void;
1891
+ on(event: string, fn: (...args: any[]) => void): void;
1893
1892
  getView(): {
1894
1893
  getNode(record: NodeInterface): HTMLElement | null;
1895
1894
  };
package/dist/index.js CHANGED
@@ -298,6 +298,7 @@ var ZIndexManager = class _ZIndexManager {
298
298
  static instance = null;
299
299
  /** Ordered stack, lowest first, highest last. */
300
300
  stack = [];
301
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
301
302
  constructor() {
302
303
  }
303
304
  static getInstance() {
@@ -697,9 +698,9 @@ var MessageBox = class _MessageBox {
697
698
  };
698
699
 
699
700
  // src/button/Button.ts
700
- import { Component as Component2 } from "@framesquared/component";
701
+ import { Component } from "@framesquared/component";
701
702
  var toggleGroups = /* @__PURE__ */ new Map();
702
- var Button = class extends Component2 {
703
+ var Button = class extends Component {
703
704
  static $className = "Ext.button.Button";
704
705
  constructor(config = {}) {
705
706
  super({ xtype: "button", ...config });
@@ -737,7 +738,11 @@ var Button = class extends Component2 {
737
738
  if (target) {
738
739
  if (typeof position === "number") {
739
740
  const ref = target.children[position];
740
- ref ? target.insertBefore(this.el, ref) : target.appendChild(this.el);
741
+ if (ref) {
742
+ target.insertBefore(this.el, ref);
743
+ } else {
744
+ target.appendChild(this.el);
745
+ }
741
746
  } else if (position instanceof Element) {
742
747
  target.insertBefore(this.el, position);
743
748
  } else {
@@ -1100,7 +1105,7 @@ var SegmentedButton = class extends Container2 {
1100
1105
  };
1101
1106
 
1102
1107
  // src/toolbar/Toolbar.ts
1103
- import { Component as Component3, Container as Container3 } from "@framesquared/component";
1108
+ import { Component as Component2, Container as Container3 } from "@framesquared/component";
1104
1109
  var Toolbar = class extends Container3 {
1105
1110
  static $className = "Ext.toolbar.Toolbar";
1106
1111
  constructor(config = {}) {
@@ -1124,14 +1129,14 @@ var Toolbar = class extends Container3 {
1124
1129
  }
1125
1130
  };
1126
1131
  function resolveToolbarItem(item) {
1127
- if (item instanceof Component3) return item;
1132
+ if (item instanceof Component2) return item;
1128
1133
  if (item === "->") return new ToolbarFill();
1129
1134
  if (item === "-") return new ToolbarSeparator();
1130
1135
  if (item === " ") return new ToolbarSpacer();
1131
1136
  if (typeof item === "string") return new ToolbarTextItem({ text: item });
1132
1137
  return item;
1133
1138
  }
1134
- var ToolbarFill = class extends Component3 {
1139
+ var ToolbarFill = class extends Component2 {
1135
1140
  constructor() {
1136
1141
  super({});
1137
1142
  }
@@ -1141,7 +1146,7 @@ var ToolbarFill = class extends Component3 {
1141
1146
  this.el.style.flexGrow = "1";
1142
1147
  }
1143
1148
  };
1144
- var ToolbarSeparator = class extends Component3 {
1149
+ var ToolbarSeparator = class extends Component2 {
1145
1150
  constructor() {
1146
1151
  super({});
1147
1152
  }
@@ -1150,7 +1155,7 @@ var ToolbarSeparator = class extends Component3 {
1150
1155
  this.el.classList.add("x-toolbar-separator");
1151
1156
  }
1152
1157
  };
1153
- var ToolbarSpacer = class extends Component3 {
1158
+ var ToolbarSpacer = class extends Component2 {
1154
1159
  constructor() {
1155
1160
  super({});
1156
1161
  }
@@ -1160,7 +1165,7 @@ var ToolbarSpacer = class extends Component3 {
1160
1165
  this.el.style.width = "8px";
1161
1166
  }
1162
1167
  };
1163
- var ToolbarTextItem = class extends Component3 {
1168
+ var ToolbarTextItem = class extends Component2 {
1164
1169
  constructor(config) {
1165
1170
  super({ html: config.text });
1166
1171
  }
@@ -1293,6 +1298,7 @@ var MenuManager = class _MenuManager {
1293
1298
  static instance = null;
1294
1299
  menus = [];
1295
1300
  listening = false;
1301
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1296
1302
  constructor() {
1297
1303
  }
1298
1304
  static getInstance() {
@@ -1411,8 +1417,8 @@ var Menu = class extends Container4 {
1411
1417
  };
1412
1418
 
1413
1419
  // src/menu/MenuItem.ts
1414
- import { Component as Component4 } from "@framesquared/component";
1415
- var MenuItem = class extends Component4 {
1420
+ import { Component as Component3 } from "@framesquared/component";
1421
+ var MenuItem = class extends Component3 {
1416
1422
  static $className = "Ext.menu.MenuItem";
1417
1423
  constructor(config = {}) {
1418
1424
  super({ xtype: "menuitem", ...config });
@@ -1454,9 +1460,9 @@ var MenuItem = class extends Component4 {
1454
1460
  };
1455
1461
 
1456
1462
  // src/menu/CheckItem.ts
1457
- import { Component as Component5 } from "@framesquared/component";
1463
+ import { Component as Component4 } from "@framesquared/component";
1458
1464
  var checkGroups = /* @__PURE__ */ new Map();
1459
- var CheckItem = class extends Component5 {
1465
+ var CheckItem = class extends Component4 {
1460
1466
  static $className = "Ext.menu.CheckItem";
1461
1467
  constructor(config = {}) {
1462
1468
  super({ xtype: "menucheckitem", ...config });
@@ -1535,8 +1541,8 @@ var CheckItem = class extends Component5 {
1535
1541
  };
1536
1542
 
1537
1543
  // src/menu/Separator.ts
1538
- import { Component as Component6 } from "@framesquared/component";
1539
- var MenuSeparator = class extends Component6 {
1544
+ import { Component as Component5 } from "@framesquared/component";
1545
+ var MenuSeparator = class extends Component5 {
1540
1546
  static $className = "Ext.menu.Separator";
1541
1547
  constructor(config = {}) {
1542
1548
  super({ xtype: "menuseparator", ...config });
@@ -1549,8 +1555,8 @@ var MenuSeparator = class extends Component6 {
1549
1555
  };
1550
1556
 
1551
1557
  // src/tip/Tooltip.ts
1552
- import { Component as Component7 } from "@framesquared/component";
1553
- var Tooltip = class extends Component7 {
1558
+ import { Component as Component6 } from "@framesquared/component";
1559
+ var Tooltip = class extends Component6 {
1554
1560
  static $className = "Ext.tip.Tooltip";
1555
1561
  constructor(config = {}) {
1556
1562
  super({ xtype: "tooltip", ...config });
@@ -1874,8 +1880,8 @@ var QuickTip = class {
1874
1880
  };
1875
1881
 
1876
1882
  // src/view/DataView.ts
1877
- import { Component as Component8 } from "@framesquared/component";
1878
- var DataView = class extends Component8 {
1883
+ import { Component as Component7 } from "@framesquared/component";
1884
+ var DataView = class extends Component7 {
1879
1885
  static $className = "Ext.view.DataView";
1880
1886
  constructor(config = {}) {
1881
1887
  super({ xtype: "dataview", ...config });
@@ -2022,8 +2028,8 @@ var DataView = class extends Component8 {
2022
2028
  };
2023
2029
 
2024
2030
  // src/view/ListView.ts
2025
- import { Component as Component9 } from "@framesquared/component";
2026
- var ListView = class extends Component9 {
2031
+ import { Component as Component8 } from "@framesquared/component";
2032
+ var ListView = class extends Component8 {
2027
2033
  static $className = "Ext.view.ListView";
2028
2034
  constructor(config = {}) {
2029
2035
  super({ xtype: "listview", ...config });
@@ -2112,8 +2118,8 @@ var ListView = class extends Component9 {
2112
2118
  };
2113
2119
 
2114
2120
  // src/tab/TabBar.ts
2115
- import { Component as Component10 } from "@framesquared/component";
2116
- var TabBar = class extends Component10 {
2121
+ import { Component as Component9 } from "@framesquared/component";
2122
+ var TabBar = class extends Component9 {
2117
2123
  static $className = "Ext.tab.Bar";
2118
2124
  constructor(config = {}) {
2119
2125
  super({ xtype: "tabbar", ...config });
@@ -2160,8 +2166,8 @@ var TabBar = class extends Component10 {
2160
2166
  };
2161
2167
 
2162
2168
  // src/tab/Tab.ts
2163
- import { Component as Component11 } from "@framesquared/component";
2164
- var Tab = class extends Component11 {
2169
+ import { Component as Component10 } from "@framesquared/component";
2170
+ var Tab = class extends Component10 {
2165
2171
  static $className = "Ext.tab.Tab";
2166
2172
  constructor(config = {}) {
2167
2173
  super({ xtype: "tab", ...config });
@@ -2584,8 +2590,8 @@ var CardContainer = class extends Container7 {
2584
2590
  };
2585
2591
 
2586
2592
  // src/navigation/Breadcrumb.ts
2587
- import { Component as Component12 } from "@framesquared/component";
2588
- var Breadcrumb = class extends Component12 {
2593
+ import { Component as Component11 } from "@framesquared/component";
2594
+ var Breadcrumb = class extends Component11 {
2589
2595
  static $className = "Ext.navigation.Breadcrumb";
2590
2596
  constructor(config = {}) {
2591
2597
  super({ xtype: "breadcrumb", ...config });
@@ -4055,7 +4061,7 @@ var TreeGridColumn = class extends Column {
4055
4061
  showExpanders;
4056
4062
  innerRenderer;
4057
4063
  constructor(config = {}) {
4058
- super({ ...config, dataIndex: config.dataIndex ?? (config.displayProperty ?? "text") });
4064
+ super({ ...config, dataIndex: config.dataIndex ?? config.displayProperty ?? "text" });
4059
4065
  this.indentSize = config.indentSize ?? 20;
4060
4066
  this.iconProperty = config.iconProperty ?? "icon";
4061
4067
  this.iconClsProperty = config.iconClsProperty ?? "iconCls";
@@ -4259,8 +4265,7 @@ var TreeGridView = class {
4259
4265
  else if (!isExplicitLeaf) tr.classList.add("x-treegrid-collapsed");
4260
4266
  if (isExplicitLeaf) tr.classList.add("x-treegrid-leaf");
4261
4267
  if (node.isRoot()) tr.classList.add("x-treegrid-root-node");
4262
- for (let i = 0; i < this.columns.length; i++) {
4263
- const col = this.columns[i];
4268
+ for (const col of this.columns) {
4264
4269
  if (col.hidden) continue;
4265
4270
  const td = document.createElement("td");
4266
4271
  td.className = "x-grid-cell";
@@ -4601,6 +4606,7 @@ var TreeGridView = class {
4601
4606
  var TreeGridSelectionModel = class {
4602
4607
  mode;
4603
4608
  selected = /* @__PURE__ */ new Set();
4609
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4604
4610
  listeners = /* @__PURE__ */ new Map();
4605
4611
  deselectOnCollapse;
4606
4612
  pruneRemoved;
@@ -4615,10 +4621,12 @@ var TreeGridSelectionModel = class {
4615
4621
  // -------------------------------------------------------------------------
4616
4622
  // Event system
4617
4623
  // -------------------------------------------------------------------------
4624
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4618
4625
  on(event, fn) {
4619
4626
  if (!this.listeners.has(event)) this.listeners.set(event, []);
4620
4627
  this.listeners.get(event).push(fn);
4621
4628
  }
4629
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4622
4630
  un(event, fn) {
4623
4631
  const fns = this.listeners.get(event);
4624
4632
  if (!fns) return;
@@ -4824,13 +4832,19 @@ var TreeGrid = class extends Panel {
4824
4832
  this._view?.onNodeCollapse(node);
4825
4833
  this.fire("itemcollapse", node);
4826
4834
  });
4827
- this._store.on("nodeappend", (_s, child, parent) => {
4828
- if (!child || !parent) return;
4829
- this._view?.onNodeInsert(parent, child);
4830
- });
4831
- this._store.on("nodeinsert", (_s, node, _ref, parent) => {
4832
- this._view?.onNodeInsert(parent, node);
4833
- });
4835
+ this._store.on(
4836
+ "nodeappend",
4837
+ (_s, child, parent) => {
4838
+ if (!child || !parent) return;
4839
+ this._view?.onNodeInsert(parent, child);
4840
+ }
4841
+ );
4842
+ this._store.on(
4843
+ "nodeinsert",
4844
+ (_s, node, _ref, parent) => {
4845
+ this._view?.onNodeInsert(parent, node);
4846
+ }
4847
+ );
4834
4848
  this._store.on("noderemove", (_s, child) => {
4835
4849
  this._selModel.onNodeRemoved(child);
4836
4850
  this._view?.onNodeRemove(child.parentNode ?? this._store.getRootNode(), child);
@@ -4925,9 +4939,7 @@ var TreeGrid = class extends Panel {
4925
4939
  }
4926
4940
  }
4927
4941
  if (!treeColCreated) {
4928
- result.unshift(
4929
- new TreeGridColumn({ dataIndex: this._displayField, text: "Name", flex: 1 })
4930
- );
4942
+ result.unshift(new TreeGridColumn({ dataIndex: this._displayField, text: "Name", flex: 1 }));
4931
4943
  }
4932
4944
  return result;
4933
4945
  }
@@ -5127,9 +5139,7 @@ var TreeGrid = class extends Panel {
5127
5139
  }
5128
5140
  select(nodes, keepExisting = false, suppressEvent = false) {
5129
5141
  const flatData = this._store.flattenNodes();
5130
- const toSelect = (Array.isArray(nodes) ? nodes : [nodes]).map(
5131
- (n) => typeof n === "number" ? flatData[n] : n
5132
- ).filter(Boolean);
5142
+ const toSelect = (Array.isArray(nodes) ? nodes : [nodes]).map((n) => typeof n === "number" ? flatData[n] : n).filter(Boolean);
5133
5143
  this._selModel.select(toSelect, keepExisting, suppressEvent);
5134
5144
  this._updateSelectionVisuals();
5135
5145
  if (!suppressEvent) {
@@ -5138,9 +5148,7 @@ var TreeGrid = class extends Panel {
5138
5148
  }
5139
5149
  deselect(nodes, suppressEvent = false) {
5140
5150
  const flatData = this._store.flattenNodes();
5141
- const toDeselect = (Array.isArray(nodes) ? nodes : [nodes]).map(
5142
- (n) => typeof n === "number" ? flatData[n] : n
5143
- ).filter(Boolean);
5151
+ const toDeselect = (Array.isArray(nodes) ? nodes : [nodes]).map((n) => typeof n === "number" ? flatData[n] : n).filter(Boolean);
5144
5152
  this._selModel.deselect(toDeselect, suppressEvent);
5145
5153
  this._updateSelectionVisuals();
5146
5154
  }
@@ -5326,7 +5334,7 @@ var TreeGridDragDrop = class {
5326
5334
  e.target.setPointerCapture(e.pointerId);
5327
5335
  this._captureTarget = e.target;
5328
5336
  this._pointerId = e.pointerId;
5329
- } catch (_) {
5337
+ } catch {
5330
5338
  }
5331
5339
  document.addEventListener("pointermove", this._onPointerMove);
5332
5340
  document.addEventListener("pointerup", this._onPointerUp);
@@ -5525,7 +5533,7 @@ var TreeGridDragDrop = class {
5525
5533
  if (this._captureTarget !== null && this._pointerId !== null) {
5526
5534
  try {
5527
5535
  this._captureTarget.releasePointerCapture(this._pointerId);
5528
- } catch (_) {
5536
+ } catch {
5529
5537
  }
5530
5538
  this._captureTarget = null;
5531
5539
  this._pointerId = null;
@@ -5817,9 +5825,7 @@ var TreeGridCellEditing = class {
5817
5825
  return editor.valueAsNumber;
5818
5826
  }
5819
5827
  default: {
5820
- const focusable = editor.querySelector(
5821
- "input,select,textarea"
5822
- );
5828
+ const focusable = editor.querySelector("input,select,textarea");
5823
5829
  return focusable ? focusable.value : editor.value ?? "";
5824
5830
  }
5825
5831
  }
@@ -6868,6 +6874,7 @@ var TreeGridLockable = class {
6868
6874
 
6869
6875
  // src/treegrid/TreeGridExporter.ts
6870
6876
  var TreeGridExporter = class _TreeGridExporter {
6877
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor, @typescript-eslint/no-empty-function
6871
6878
  constructor(_options = {}) {
6872
6879
  }
6873
6880
  /**
@@ -6991,9 +6998,7 @@ var TreeGridExporter = class _TreeGridExporter {
6991
6998
  }
6992
6999
  static _getNodes(treeGrid, options) {
6993
7000
  if (options.expandedOnly) {
6994
- return treeGrid.getStore().flattenNodes().filter(
6995
- (n) => !n.isRoot()
6996
- );
7001
+ return treeGrid.getStore().flattenNodes().filter((n) => !n.isRoot());
6997
7002
  }
6998
7003
  const all = [];
6999
7004
  treeGrid.getRootNode().cascadeBy((n) => {
@@ -7268,6 +7273,7 @@ var TreeSelectionModel = class {
7268
7273
  selected;
7269
7274
  mode;
7270
7275
  pruneRemoved;
7276
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7271
7277
  listeners;
7272
7278
  constructor(config) {
7273
7279
  this.selected = /* @__PURE__ */ new Set();
@@ -7278,12 +7284,14 @@ var TreeSelectionModel = class {
7278
7284
  // -------------------------------------------------------------------------
7279
7285
  // Event system
7280
7286
  // -------------------------------------------------------------------------
7287
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7281
7288
  on(event, fn) {
7282
7289
  if (!this.listeners.has(event)) {
7283
7290
  this.listeners.set(event, []);
7284
7291
  }
7285
7292
  this.listeners.get(event).push(fn);
7286
7293
  }
7294
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7287
7295
  un(event, fn) {
7288
7296
  const fns = this.listeners.get(event);
7289
7297
  if (!fns) return;
@@ -7365,9 +7373,6 @@ var TreeSelectionModel = class {
7365
7373
  // src/tree/TreePanel.ts
7366
7374
  var TreePanel = class extends Panel {
7367
7375
  static $className = "Ext.tree.Panel";
7368
- constructor(config) {
7369
- super(config);
7370
- }
7371
7376
  // -------------------------------------------------------------------------
7372
7377
  // Lifecycle
7373
7378
  // -------------------------------------------------------------------------