@simplysm/angular 14.0.51 → 14.0.53

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.
Files changed (134) hide show
  1. package/dist/data/sheet/sd-sheet.d.ts +9 -12
  2. package/dist/data/sheet/sd-sheet.d.ts.map +1 -1
  3. package/dist/data/sheet/sd-sheet.js +150 -168
  4. package/dist/data/sheet/types.d.ts +1 -0
  5. package/dist/data/sheet/types.d.ts.map +1 -1
  6. package/dist/data/sheet/useSheetCellStyling.d.ts +2 -2
  7. package/dist/data/sheet/useSheetCellStyling.d.ts.map +1 -1
  8. package/dist/data/sheet/useSheetCellStyling.js +20 -12
  9. package/dist/data/sheet/useSheetColumnFixing.d.ts +3 -8
  10. package/dist/data/sheet/useSheetColumnFixing.d.ts.map +1 -1
  11. package/dist/data/sheet/useSheetColumnFixing.js +19 -27
  12. package/dist/data/sheet/useSheetLayoutEngine.d.ts.map +1 -1
  13. package/dist/data/sheet/useSheetLayoutEngine.js +4 -1
  14. package/dist/layout/dock/sd-dock-container.d.ts.map +1 -1
  15. package/dist/layout/dock/sd-dock-container.js +3 -3
  16. package/package.json +7 -8
  17. package/src/data/sheet/sd-sheet.ts +39 -60
  18. package/src/data/sheet/types.ts +1 -0
  19. package/src/data/sheet/useSheetCellStyling.ts +19 -11
  20. package/src/data/sheet/useSheetColumnFixing.ts +21 -28
  21. package/src/data/sheet/useSheetLayoutEngine.ts +4 -1
  22. package/src/layout/dock/sd-dock-container.ts +1 -0
  23. package/README.md +0 -476
  24. package/docs/bootstrap/provide-sd-angular.md +0 -37
  25. package/docs/bootstrap/sd-angular-config-provider.md +0 -16
  26. package/docs/directives/sd-command-directive.md +0 -30
  27. package/docs/directives/sd-events.md +0 -25
  28. package/docs/directives/sd-intersection-directive.md +0 -36
  29. package/docs/directives/sd-invalid.md +0 -24
  30. package/docs/directives/sd-resize-directive.md +0 -42
  31. package/docs/directives/sd-ripple.md +0 -23
  32. package/docs/directives/sd-router-link.md +0 -38
  33. package/docs/directives/sd-show-effect.md +0 -18
  34. package/docs/directives/sd-typed-template.md +0 -69
  35. package/docs/features/sd-address-search-modal.md +0 -50
  36. package/docs/features/sd-permission-table.md +0 -20
  37. package/docs/features/sd-shared-data-components.md +0 -158
  38. package/docs/features/sd-tiptap-editor.md +0 -26
  39. package/docs/pipes/format-pipe.md +0 -41
  40. package/docs/plugins/sd-global-error-handler.md +0 -23
  41. package/docs/plugins/sd-option-event-plugin.md +0 -34
  42. package/docs/provider-types/sd-menu.md +0 -65
  43. package/docs/provider-types/sd-modal-content-def.md +0 -148
  44. package/docs/provider-types/sd-toast-content-def.md +0 -73
  45. package/docs/provider-types/shared-data-base.md +0 -59
  46. package/docs/providers/sd-activated-modal-provider.md +0 -34
  47. package/docs/providers/sd-app-structure-provider.md +0 -81
  48. package/docs/providers/sd-busy-provider.md +0 -18
  49. package/docs/providers/sd-file-dialog-provider.md +0 -40
  50. package/docs/providers/sd-local-storage-provider.md +0 -20
  51. package/docs/providers/sd-modal-provider.md +0 -67
  52. package/docs/providers/sd-navigate-window-provider.md +0 -18
  53. package/docs/providers/sd-print-provider.md +0 -25
  54. package/docs/providers/sd-service-client-factory-provider.md +0 -43
  55. package/docs/providers/sd-shared-data-provider.md +0 -64
  56. package/docs/providers/sd-system-config-provider.md +0 -46
  57. package/docs/providers/sd-system-log-provider.md +0 -18
  58. package/docs/providers/sd-theme-provider.md +0 -38
  59. package/docs/providers/sd-toast-provider.md +0 -65
  60. package/docs/recipes/_common-rules.md +0 -244
  61. package/docs/recipes/crud-detail/extension-a-edit-save.md +0 -230
  62. package/docs/recipes/crud-detail/extension-b-delete-restore.md +0 -142
  63. package/docs/recipes/crud-detail/extension-c-modal-view.md +0 -214
  64. package/docs/recipes/crud-detail/extension-d-control-view.md +0 -103
  65. package/docs/recipes/crud-detail/extension-e-auxiliary.md +0 -87
  66. package/docs/recipes/crud-detail/extension-f-complex-detail.md +0 -234
  67. package/docs/recipes/crud-detail.md +0 -353
  68. package/docs/recipes/crud-list/extension-a-inline-edit.md +0 -410
  69. package/docs/recipes/crud-list/extension-b-selection.md +0 -226
  70. package/docs/recipes/crud-list/extension-c-inline-delete.md +0 -87
  71. package/docs/recipes/crud-list/extension-d-select-modal.md +0 -207
  72. package/docs/recipes/crud-list/extension-e-readonly-modal.md +0 -165
  73. package/docs/recipes/crud-list/extension-f-modal-edit.md +0 -177
  74. package/docs/recipes/crud-list/extension-g-excel.md +0 -157
  75. package/docs/recipes/crud-list.md +0 -446
  76. package/docs/recipes/data-select-button.md +0 -412
  77. package/docs/recipes/page-modal-container.md +0 -260
  78. package/docs/styling/classes.md +0 -149
  79. package/docs/styling/mixins.md +0 -100
  80. package/docs/styling/themes.md +0 -35
  81. package/docs/styling/variables.md +0 -147
  82. package/docs/type-utilities/directive-input-signals.md +0 -232
  83. package/docs/ui-data/sd-list.md +0 -37
  84. package/docs/ui-data/sd-sheet.md +0 -227
  85. package/docs/ui-form/sd-additional-button.md +0 -26
  86. package/docs/ui-form/sd-anchor.md +0 -31
  87. package/docs/ui-form/sd-button.md +0 -105
  88. package/docs/ui-form/sd-checkbox-group.md +0 -39
  89. package/docs/ui-form/sd-checkbox.md +0 -81
  90. package/docs/ui-form/sd-date-range-picker.md +0 -27
  91. package/docs/ui-form/sd-form.md +0 -89
  92. package/docs/ui-form/sd-modal-select-button.md +0 -54
  93. package/docs/ui-form/sd-numpad.md +0 -26
  94. package/docs/ui-form/sd-range.md +0 -26
  95. package/docs/ui-form/sd-select.md +0 -68
  96. package/docs/ui-form/sd-shared-data-select.md +0 -52
  97. package/docs/ui-form/sd-state-preset.md +0 -37
  98. package/docs/ui-form/sd-switch.md +0 -27
  99. package/docs/ui-form/sd-textarea.md +0 -33
  100. package/docs/ui-form/sd-textfield.md +0 -145
  101. package/docs/ui-layout/sd-dock-container.md +0 -64
  102. package/docs/ui-layout/sd-dock.md +0 -37
  103. package/docs/ui-layout/sd-gap.md +0 -26
  104. package/docs/ui-layout/sd-kanban-board.md +0 -96
  105. package/docs/ui-layout/sd-kanban-lane.md +0 -34
  106. package/docs/ui-layout/sd-kanban.md +0 -29
  107. package/docs/ui-navigation/sd-collapse.md +0 -35
  108. package/docs/ui-navigation/sd-pagination.md +0 -26
  109. package/docs/ui-navigation/sd-sidebar-container.md +0 -49
  110. package/docs/ui-navigation/sd-sidebar-menu.md +0 -22
  111. package/docs/ui-navigation/sd-sidebar-user.md +0 -43
  112. package/docs/ui-navigation/sd-tab.md +0 -51
  113. package/docs/ui-navigation/sd-topbar-container.md +0 -97
  114. package/docs/ui-navigation/sd-topbar-menu.md +0 -23
  115. package/docs/ui-navigation/sd-topbar-user.md +0 -38
  116. package/docs/ui-navigation/sd-topbar.md +0 -30
  117. package/docs/ui-overlay/sd-busy-container.md +0 -69
  118. package/docs/ui-overlay/sd-confirm-modal.md +0 -30
  119. package/docs/ui-overlay/sd-dropdown.md +0 -40
  120. package/docs/ui-overlay/sd-modal.md +0 -34
  121. package/docs/ui-overlay/sd-prompt-modal.md +0 -30
  122. package/docs/ui-overlay/sd-toast.md +0 -35
  123. package/docs/ui-visual/sd-barcode.md +0 -36
  124. package/docs/ui-visual/sd-calendar.md +0 -34
  125. package/docs/ui-visual/sd-echarts.md +0 -32
  126. package/docs/ui-visual/sd-label.md +0 -24
  127. package/docs/ui-visual/sd-note.md +0 -23
  128. package/docs/ui-visual/sd-progress.md +0 -23
  129. package/docs/utils/inject-routing-signals.md +0 -161
  130. package/docs/utils/inject-sd-system-config-resource.md +0 -35
  131. package/docs/utils/mark.md +0 -43
  132. package/docs/utils/selection-managers.md +0 -96
  133. package/docs/utils/set-safe-style.md +0 -19
  134. package/docs/utils/setup-functions.md +0 -93
@@ -17,6 +17,7 @@ export interface SdSheetHeaderDef {
17
17
  rowspan: number;
18
18
  isLastRow: boolean;
19
19
  colDef: SdSheetColumnDef | undefined;
20
+ colIndex: number;
20
21
  }
21
22
  export interface SdSheetConfig {
22
23
  columnRecord: Record<string, {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAClB,MAAM,EACN;QACE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CACF,CAAC;CACH;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,aAAa,CAAC;CACtB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAClB,MAAM,EACN;QACE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CACF,CAAC;CACH;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,aAAa,CAAC;CACtB"}
@@ -3,7 +3,7 @@ import type { SdSheetColumnDef, SdSheetHeaderDef } from "./types";
3
3
  import type { ExpandItemDef } from "../../core/selection/useExpandingManager";
4
4
  export declare function useSheetCellStyling<T>(options: {
5
5
  columnDefs: Signal<SdSheetColumnDef[]>;
6
- fixedLeftMap: Signal<Map<string, number>>;
6
+ fixedLeftMap: Signal<Map<number, number>>;
7
7
  getItemCellStyleFn: Signal<((item: T, colKey: string) => string | undefined) | undefined>;
8
8
  getItemCellClassFn: Signal<((item: T, colKey: string) => string) | undefined>;
9
9
  getChildrenFn: Signal<((item: T, index: number) => T[] | undefined) | undefined>;
@@ -15,7 +15,7 @@ export declare function useSheetCellStyling<T>(options: {
15
15
  }): {
16
16
  getHeaderCellStyle: (cell: SdSheetHeaderDef) => string | null;
17
17
  getCellStyle: (item: T, colDef: SdSheetColumnDef) => string | null;
18
- getFixedCellStyle: (colDef: SdSheetColumnDef) => string | null;
18
+ getFixedCellStyle: (colIdx: number) => string | null;
19
19
  getCellStyleWithIndent: (item: T, colDef: SdSheetColumnDef, colIdx: number) => string | null;
20
20
  getDataCellClass: (item: T, colDef: SdSheetColumnDef, r: number, c: number) => string | null;
21
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useSheetCellStyling.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/useSheetCellStyling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAE9E,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE;IAC9C,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1F,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;IAC9E,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;IACjF,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5C,cAAc,EAAE,CAAC,IAAI,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;CAC7D;+BA4CmC,gBAAgB,KAAG,MAAM,GAAG,IAAI;yBAStC,CAAC,UAAU,gBAAgB,KAAG,MAAM,GAAG,IAAI;gCAQpC,gBAAgB,KAAG,MAAM,GAAG,IAAI;mCAI7B,CAAC,UAAU,gBAAgB,UAAU,MAAM,KAAG,MAAM,GAAG,IAAI;6BAejE,CAAC,UAAU,gBAAgB,KAAK,MAAM,KAAK,MAAM,KAAG,MAAM,GAAG,IAAI;EAoBlG"}
1
+ {"version":3,"file":"useSheetCellStyling.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/useSheetCellStyling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAE9E,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE;IAC9C,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1F,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;IAC9E,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;IACjF,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5C,cAAc,EAAE,CAAC,IAAI,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;CAC7D;+BAoDmC,gBAAgB,KAAG,MAAM,GAAG,IAAI;yBAStC,CAAC,UAAU,gBAAgB,KAAG,MAAM,GAAG,IAAI;gCAQpC,MAAM,KAAG,MAAM,GAAG,IAAI;mCAInB,CAAC,UAAU,gBAAgB,UAAU,MAAM,KAAG,MAAM,GAAG,IAAI;6BAejE,CAAC,UAAU,gBAAgB,KAAK,MAAM,KAAK,MAAM,KAAG,MAAM,GAAG,IAAI;EAoBlG"}
@@ -9,36 +9,44 @@ export function useSheetCellStyling(options) {
9
9
  }
10
10
  return null;
11
11
  }
12
- function getFixedStyle(colDef) {
13
- const leftValue = options.fixedLeftMap().get(colDef.key);
12
+ function getFixedLeftStyle(colIdx) {
13
+ const leftValue = options.fixedLeftMap().get(colIdx);
14
14
  if (leftValue == null)
15
15
  return null;
16
16
  return `left: ${leftValue}px`;
17
17
  }
18
18
  const headerColumnStyles = computed(() => {
19
19
  const map = new Map();
20
- for (const colDef of options.columnDefs()) {
20
+ const defs = options.columnDefs();
21
+ for (let i = 0; i < defs.length; i++) {
22
+ const colDef = defs[i];
21
23
  const parts = [];
22
24
  const colStyle = getColDefStyle(colDef);
23
25
  if (colStyle != null)
24
26
  parts.push(colStyle);
25
- const fixedStyle = getFixedStyle(colDef);
26
- if (fixedStyle != null)
27
- parts.push(fixedStyle);
27
+ if (colDef.fixed) {
28
+ const fixedStyle = getFixedLeftStyle(i);
29
+ if (fixedStyle != null)
30
+ parts.push(fixedStyle);
31
+ }
28
32
  map.set(colDef.key, parts.length > 0 ? parts.join("; ") : null);
29
33
  }
30
34
  return map;
31
35
  }, ...(ngDevMode ? [{ debugName: "headerColumnStyles" }] : /* istanbul ignore next */ []));
32
36
  const dataColumnBaseStyles = computed(() => {
33
37
  const map = new Map();
34
- for (const colDef of options.columnDefs()) {
38
+ const defs = options.columnDefs();
39
+ for (let i = 0; i < defs.length; i++) {
40
+ const colDef = defs[i];
35
41
  const parts = [];
36
42
  const colStyle = getColDefStyle(colDef);
37
43
  if (colStyle != null)
38
44
  parts.push(colStyle);
39
- const fixedStyle = getFixedStyle(colDef);
40
- if (fixedStyle != null)
41
- parts.push(fixedStyle);
45
+ if (colDef.fixed) {
46
+ const fixedStyle = getFixedLeftStyle(i);
47
+ if (fixedStyle != null)
48
+ parts.push(fixedStyle);
49
+ }
42
50
  map.set(colDef.key, parts.length > 0 ? parts.join("; ") : null);
43
51
  }
44
52
  return map;
@@ -62,8 +70,8 @@ export function useSheetCellStyling(options) {
62
70
  return `${baseStyle}; ${customStyle}`;
63
71
  return customStyle ?? baseStyle ?? null;
64
72
  }
65
- function getFixedCellStyle(colDef) {
66
- return getFixedStyle(colDef);
73
+ function getFixedCellStyle(colIdx) {
74
+ return getFixedLeftStyle(colIdx);
67
75
  }
68
76
  function getCellStyleWithIndent(item, colDef, colIdx) {
69
77
  const parts = [];
@@ -1,15 +1,10 @@
1
1
  import { type Signal } from "@angular/core";
2
2
  import type { SdSheetColumnDef } from "./types";
3
- /**
4
- * Fixed column의 left offset을 계산한다.
5
- *
6
- * **주의:** fixed column의 `width`는 반드시 px 단위여야 정확한 offset이 계산된다.
7
- * em, rem, % 등 non-px 단위의 width는 offset 누적에 반영되지 않는다 (0으로 처리).
8
- */
9
3
  export declare function useSheetColumnFixing(options: {
10
4
  columnDefs: Signal<SdSheetColumnDef[]>;
5
+ cellWidths: Signal<Map<number, number>>;
6
+ hasExpandable: Signal<boolean>;
11
7
  }): {
12
- fixedLeftMap: Signal<Map<string, number>>;
13
- hasFixed: Signal<boolean>;
8
+ fixedLeftMap: Signal<Map<number, number>>;
14
9
  };
15
10
  //# sourceMappingURL=useSheetColumnFixing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSheetColumnFixing.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/useSheetColumnFixing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;CACxC;;;EA+BA"}
1
+ {"version":3,"file":"useSheetColumnFixing.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/useSheetColumnFixing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CAChC;;EA4BA"}
@@ -1,35 +1,27 @@
1
1
  import { computed } from "@angular/core";
2
- /**
3
- * Fixed column의 left offset을 계산한다.
4
- *
5
- * **주의:** fixed column의 `width`는 반드시 px 단위여야 정확한 offset이 계산된다.
6
- * em, rem, % 등 non-px 단위의 width는 offset 누적에 반영되지 않는다 (0으로 처리).
7
- */
8
2
  export function useSheetColumnFixing(options) {
9
3
  const fixedLeftMap = computed(() => {
10
- const map = new Map();
11
- let accumulatedLeft = 0;
12
- for (const colDef of options.columnDefs()) {
13
- if (!colDef.fixed)
14
- continue;
15
- if (colDef.collapse)
16
- continue;
17
- map.set(colDef.key, accumulatedLeft);
18
- const width = colDef.width;
19
- if (width != null && width.endsWith("px")) {
20
- const px = parseFloat(width);
21
- if (!Number.isNaN(px)) {
22
- accumulatedLeft += px;
23
- }
4
+ const widths = options.cellWidths();
5
+ const fixedIndices = [];
6
+ if (options.hasExpandable()) {
7
+ fixedIndices.push(-2, -1);
8
+ }
9
+ else {
10
+ fixedIndices.push(-1);
11
+ }
12
+ const defs = options.columnDefs();
13
+ for (let i = 0; i < defs.length; i++) {
14
+ if (defs[i].fixed && !defs[i].collapse) {
15
+ fixedIndices.push(i);
24
16
  }
25
17
  }
18
+ const map = new Map();
19
+ let accLeft = 0;
20
+ for (const idx of fixedIndices) {
21
+ map.set(idx, accLeft);
22
+ accLeft += widths.get(idx) ?? 0;
23
+ }
26
24
  return map;
27
25
  }, ...(ngDevMode ? [{ debugName: "fixedLeftMap" }] : /* istanbul ignore next */ []));
28
- const hasFixed = computed(() => {
29
- return fixedLeftMap().size > 0;
30
- }, ...(ngDevMode ? [{ debugName: "hasFixed" }] : /* istanbul ignore next */ []));
31
- return {
32
- fixedLeftMap,
33
- hasFixed,
34
- };
26
+ return { fixedLeftMap };
35
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useSheetLayoutEngine.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/useSheetLayoutEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,cAAc,EAAE,MAAM,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;CAC3C;;;;;;EA0IA"}
1
+ {"version":3,"file":"useSheetLayoutEngine.d.ts","sourceRoot":"","sources":["../../../src/data/sheet/useSheetLayoutEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,cAAc,EAAE,MAAM,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;CAC3C;;;;;;EA6IA"}
@@ -46,7 +46,8 @@ export function useSheetLayoutEngine(options) {
46
46
  }
47
47
  // Track the header array of the first column in each cell span per row
48
48
  const spanStartHeaders = new Array(depth);
49
- for (const colDef of cols) {
49
+ for (let colIdx = 0; colIdx < cols.length; colIdx++) {
50
+ const colDef = cols[colIdx];
50
51
  const headers = Array.isArray(colDef.header)
51
52
  ? colDef.header
52
53
  : [colDef.header];
@@ -61,6 +62,7 @@ export function useSheetLayoutEngine(options) {
61
62
  rowspan,
62
63
  isLastRow: true,
63
64
  colDef,
65
+ colIndex: colIdx,
64
66
  });
65
67
  spanStartHeaders[row] = headers;
66
68
  break;
@@ -108,6 +110,7 @@ export function useSheetLayoutEngine(options) {
108
110
  rowspan: 1,
109
111
  isLastRow,
110
112
  colDef: isLastRow ? colDef : undefined,
113
+ colIndex: colIdx,
111
114
  });
112
115
  spanStartHeaders[row] = headers;
113
116
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sd-dock-container.d.ts","sourceRoot":"","sources":["../../../src/layout/dock/sd-dock-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EAIX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;;AAEnC,qBAyBa,eAAe;IAC1B,YAAY,oDAA2B;IAEvC,YAAY,6DAET;IAEH,YAAY,0DAAmB;;yCAPpB,eAAe;2CAAf,eAAe;CA8D3B"}
1
+ {"version":3,"file":"sd-dock-container.d.ts","sourceRoot":"","sources":["../../../src/layout/dock/sd-dock-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EAIX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;;AAEnC,qBA0Ba,eAAe;IAC1B,YAAY,oDAA2B;IAEvC,YAAY,6DAET;IAEH,YAAY,0DAAmB;;yCAPpB,eAAe;2CAAf,eAAe;CA8D3B"}
@@ -81,7 +81,7 @@ export class SdDockContainer {
81
81
  i0.ɵɵdomElementEnd();
82
82
  } if (rf & 2) {
83
83
  i0.ɵɵclassMap(i0.ɵɵpureFunction1(3, _c2, ctx.contentClass()).filter(i0.ɵɵarrowFunction(2, arrowFn0, ctx)).join(" "));
84
- } }, styles: ["sd-dock-container {\n display: block;\n height: 100%;\n}\nsd-dock-container > ._content {\n position: relative;\n height: 100%;\n}"], encapsulation: 2, changeDetection: 0 });
84
+ } }, styles: ["sd-dock-container {\n display: block;\n height: 100%;\n overflow: auto;\n}\nsd-dock-container > ._content {\n position: relative;\n height: 100%;\n}"], encapsulation: 2, changeDetection: 0 });
85
85
  }
86
86
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdDockContainer, [{
87
87
  type: Component,
@@ -89,8 +89,8 @@ export class SdDockContainer {
89
89
  <div #content [class]="['_content', contentClass()].filter((v) => v != null).join(' ')">
90
90
  <ng-content />
91
91
  </div>
92
- `, styles: ["sd-dock-container {\n display: block;\n height: 100%;\n}\nsd-dock-container > ._content {\n position: relative;\n height: 100%;\n}"] }]
92
+ `, styles: ["sd-dock-container {\n display: block;\n height: 100%;\n overflow: auto;\n}\nsd-dock-container > ._content {\n position: relative;\n height: 100%;\n}"] }]
93
93
  }], () => [], { dockControls: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdDock), { isSignal: true }] }], contentElRef: [{ type: i0.ViewChild, args: ["content", { ...{
94
94
  read: ElementRef,
95
95
  }, isSignal: true }] }], contentClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentClass", required: false }] }] }); })();
96
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdDockContainer, { className: "SdDockContainer", filePath: "packages/angular/src/layout/dock/sd-dock-container.ts", lineNumber: 38 }); })();
96
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdDockContainer, { className: "SdDockContainer", filePath: "packages/angular/src/layout/dock/sd-dock-container.ts", lineNumber: 39 }); })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/angular",
3
- "version": "14.0.51",
3
+ "version": "14.0.53",
4
4
  "description": "심플리즘 패키지 - Angular",
5
5
  "author": "심플리즘",
6
6
  "license": "Apache-2.0",
@@ -16,8 +16,7 @@
16
16
  "files": [
17
17
  "dist",
18
18
  "src",
19
- "scss",
20
- "docs"
19
+ "scss"
21
20
  ],
22
21
  "sideEffects": [
23
22
  "./src/index.ts",
@@ -45,16 +44,16 @@
45
44
  "@tiptap/extension-text-style": "^3.22.4",
46
45
  "@tiptap/extension-underline": "^3.22.4",
47
46
  "@tiptap/starter-kit": "^3.22.4",
48
- "bwip-js": "^4.9.2",
47
+ "bwip-js": "^4.10.1",
49
48
  "echarts": "^6.0.0",
50
49
  "html-to-image": "^1.11.13",
51
50
  "jspdf": "^4.2.1",
52
51
  "rxjs": "^7.8.2",
53
52
  "tabbable": "^6.4.0",
54
- "@simplysm/core-common": "14.0.51",
55
- "@simplysm/service-common": "14.0.51",
56
- "@simplysm/service-client": "14.0.51",
57
- "@simplysm/core-browser": "14.0.51"
53
+ "@simplysm/core-browser": "14.0.53",
54
+ "@simplysm/service-client": "14.0.53",
55
+ "@simplysm/core-common": "14.0.53",
56
+ "@simplysm/service-common": "14.0.53"
58
57
  },
59
58
  "devDependencies": {
60
59
  "@angular/compiler": "^21.2.9",
@@ -4,13 +4,11 @@ import {
4
4
  Component,
5
5
  computed,
6
6
  contentChildren,
7
- effect,
8
7
  inject,
9
8
  input,
10
9
  model,
11
10
  output,
12
11
  signal,
13
- untracked,
14
12
  ViewEncapsulation,
15
13
  } from "@angular/core";
16
14
  import { NgTemplateOutlet } from "@angular/common";
@@ -106,8 +104,8 @@ import { SdEvents } from "../../core/events/sd-events";
106
104
  layout.headerFeatureRowSpan() > 1 ? layout.headerFeatureRowSpan() : null
107
105
  "
108
106
  [attr.data-c]="_fc"
109
- [style.left.px]="featureFixedLeftMap().get(_fc)"
110
- (sdResize)="onFeatureCellResize($event, _fc)"
107
+ [style.left.px]="fixing.fixedLeftMap().get(_fc)"
108
+ (sdResize)="onFixedCellResize($event, _fc)"
111
109
  >
112
110
  @if (selection.hasSelectable() && selectMode() === "multi") {
113
111
  <sd-checkbox
@@ -125,8 +123,8 @@ import { SdEvents } from "../../core/events/sd-events";
125
123
  layout.headerFeatureRowSpan() > 1 ? layout.headerFeatureRowSpan() : null
126
124
  "
127
125
  [attr.data-c]="-1"
128
- [style.left.px]="featureFixedLeftMap().get(-1)"
129
- (sdResize)="onFeatureCellResize($event, -1)"
126
+ [style.left.px]="fixing.fixedLeftMap().get(-1)"
127
+ (sdResize)="onFixedCellResize($event, -1)"
130
128
  >
131
129
  <ng-icon
132
130
  [svg]="icons.tablerCaretRight"
@@ -137,16 +135,16 @@ import { SdEvents } from "../../core/events/sd-events";
137
135
  </th>
138
136
  }
139
137
  }
140
- @for (cell of row; track $index; let c = $index) {
138
+ @for (cell of row; track $index) {
141
139
  @if (!cell.isLastRow) {
142
140
  <th
143
141
  [class._fixed]="cell.colDef?.fixed"
144
142
  [attr.colspan]="cell.colspan > 1 ? cell.colspan : null"
145
143
  [attr.rowspan]="cell.rowspan > 1 ? cell.rowspan : null"
146
- [attr.data-c]="c"
144
+ [attr.data-c]="cell.colIndex"
147
145
  [attr.title]="cell.text"
148
146
  [style.left.px]="
149
- cell.colDef?.fixed ? fixing.fixedLeftMap().get(cell.colDef!.key) : null
147
+ cell.colDef?.fixed ? fixing.fixedLeftMap().get(cell.colIndex) : null
150
148
  "
151
149
  >
152
150
  <div class="_p-sheet">
@@ -160,10 +158,11 @@ import { SdEvents } from "../../core/events/sd-events";
160
158
  [class._sort]="cell.colDef && !cell.colDef.disableSorting"
161
159
  [attr.colspan]="cell.colspan > 1 ? cell.colspan : null"
162
160
  [attr.rowspan]="cell.rowspan > 1 ? cell.rowspan : null"
163
- [attr.data-c]="c"
161
+ [attr.data-c]="cell.colIndex"
164
162
  [attr.title]="cell.colDef?.tooltip ?? cell.text"
165
163
  [class.help]="cell.colDef?.tooltip"
166
164
  [style]="getHeaderCellStyle(cell)"
165
+ (sdResize)="onFixedCellResize($event, cell.colIndex)"
167
166
  (click)="onHeaderClick($event, cell)"
168
167
  >
169
168
  <div class="_headerContent flex-row">
@@ -206,15 +205,22 @@ import { SdEvents } from "../../core/events/sd-events";
206
205
  }
207
206
  @if (layout.hasSummary()) {
208
207
  <tr class="_summary-row">
209
- <th class="_fixed _feature-cell"></th>
208
+ @let _sfc = expanding.hasExpandable() ? -2 : -1;
209
+ <th
210
+ class="_fixed _feature-cell"
211
+ [style.left.px]="fixing.fixedLeftMap().get(_sfc)"
212
+ ></th>
210
213
  @if (expanding.hasExpandable()) {
211
- <th class="_fixed _feature-cell"></th>
214
+ <th
215
+ class="_fixed _feature-cell"
216
+ [style.left.px]="fixing.fixedLeftMap().get(-1)"
217
+ ></th>
212
218
  }
213
219
  @for (colDef of layout.columnDefs(); track colDef.key; let c = $index) {
214
220
  <th
215
221
  [class._fixed]="colDef.fixed"
216
222
  [attr.data-c]="c"
217
- [style.left.px]="colDef.fixed ? fixing.fixedLeftMap().get(colDef.key) : null"
223
+ [style.left.px]="colDef.fixed ? fixing.fixedLeftMap().get(c) : null"
218
224
  >
219
225
  @if (getColumnSummaryTpl(colDef.key); as tpl) {
220
226
  <ng-template [ngTemplateOutlet]="tpl" />
@@ -236,7 +242,7 @@ import { SdEvents } from "../../core/events/sd-events";
236
242
  class="_fixed _feature-cell"
237
243
  [attr.data-r]="rowIdx"
238
244
  [attr.data-c]="_fc"
239
- [style.left.px]="featureFixedLeftMap().get(_fc)"
245
+ [style.left.px]="fixing.fixedLeftMap().get(_fc)"
240
246
  >
241
247
  @if (selectMode() === "multi") {
242
248
  @let _selectable = selection.getSelectable(item);
@@ -268,7 +274,7 @@ import { SdEvents } from "../../core/events/sd-events";
268
274
  class="_fixed _feature-cell"
269
275
  [attr.data-r]="rowIdx"
270
276
  [attr.data-c]="-1"
271
- [style.left.px]="featureFixedLeftMap().get(-1)"
277
+ [style.left.px]="fixing.fixedLeftMap().get(-1)"
272
278
  >
273
279
  @let itemDef = getItemDef(item);
274
280
  @if (itemDef.depth > 0) {
@@ -580,7 +586,6 @@ export class SdSheet<T> {
580
586
  getItemCellClassFn = input<(item: T, colKey: string) => string>();
581
587
  getItemCellStyleFn = input<(item: T, colKey: string) => string | undefined>();
582
588
  hideConfigBar = input(false, { transform: booleanAttribute });
583
- cumulativeSelection = input(false, { transform: booleanAttribute });
584
589
 
585
590
  // Outputs
586
591
  itemKeydown = output<SdSheetItemKeydownEventParam<T>>();
@@ -594,6 +599,10 @@ export class SdSheet<T> {
594
599
 
595
600
  // Content query
596
601
  columnControls = contentChildren(SdSheetColumn);
602
+ columnControlsInput = input<readonly SdSheetColumn[]>();
603
+ private readonly _effectiveColumnControls = computed(
604
+ () => this.columnControlsInput() ?? this.columnControls(),
605
+ );
597
606
 
598
607
  // Injected providers
599
608
  private readonly _sdModal = inject(SdModalProvider);
@@ -619,32 +628,10 @@ export class SdSheet<T> {
619
628
 
620
629
  // Layout engine
621
630
  layout = useSheetLayoutEngine({
622
- columnControls: this.columnControls,
631
+ columnControls: this._effectiveColumnControls,
623
632
  config: computed(() => this._configResource.value()),
624
633
  });
625
634
 
626
- // Column fixing
627
- fixing = useSheetColumnFixing({
628
- columnDefs: this.layout.columnDefs,
629
- });
630
-
631
- // Feature cell fixing (select/expand columns)
632
- private readonly _featureCellWidths = signal(new Map<number, number>());
633
-
634
- featureFixedLeftMap = computed(() => {
635
- const map = new Map<number, number>();
636
- const widths = this._featureCellWidths();
637
- const hasExpand = this.expanding.hasExpandable();
638
-
639
- if (hasExpand) {
640
- map.set(-2, 0);
641
- map.set(-1, widths.get(-2) ?? 0);
642
- } else {
643
- map.set(-1, 0);
644
- }
645
- return map;
646
- });
647
-
648
635
  // Sorting manager
649
636
  sorting = useSortingManager({
650
637
  sorts: this.sorts,
@@ -665,6 +652,15 @@ export class SdSheet<T> {
665
652
  expanding = this._pipeline.expanding;
666
653
  displayItems = this._pipeline.displayItems;
667
654
 
655
+ // Column fixing (DOM 측정 기반 통합 fixedLeftMap)
656
+ private readonly _fixedCellWidths = signal(new Map<number, number>());
657
+
658
+ fixing = useSheetColumnFixing({
659
+ columnDefs: this.layout.columnDefs,
660
+ cellWidths: this._fixedCellWidths,
661
+ hasExpandable: this.expanding.hasExpandable,
662
+ });
663
+
668
664
  // Cell styling composable
669
665
  private readonly _styling = useSheetCellStyling<T>({
670
666
  columnDefs: this.layout.columnDefs,
@@ -702,23 +698,6 @@ export class SdSheet<T> {
702
698
  trackByFn: this.trackByFn,
703
699
  });
704
700
 
705
- // cumulativeSelection=false면 items 변경 시 selectedItems를 초기화한다.
706
- // 첫 실행(초기 마운트)은 skip하여 소비자가 넘긴 초기 selectedItems 값을 보존한다.
707
- private _resetOnItemsChangeSkipFirst = true;
708
- private readonly _resetOnItemsChange = effect(() => {
709
- this.items(); // track only items
710
- if (this._resetOnItemsChangeSkipFirst) {
711
- this._resetOnItemsChangeSkipFirst = false;
712
- return;
713
- }
714
- untracked(() => {
715
- if (this.cumulativeSelection()) return;
716
- if (this.selectedItems().length > 0) {
717
- this.selectedItems.set([]);
718
- }
719
- });
720
- });
721
-
722
701
  // Icons
723
702
  icons = {
724
703
  tablerSettings,
@@ -731,7 +710,7 @@ export class SdSheet<T> {
731
710
 
732
711
  private readonly _columnControlMap = computed(() => {
733
712
  const map = new Map<string, SdSheetColumn>();
734
- for (const col of this.columnControls()) {
713
+ for (const col of this._effectiveColumnControls()) {
735
714
  map.set(col.key(), col);
736
715
  }
737
716
  return map;
@@ -845,10 +824,10 @@ export class SdSheet<T> {
845
824
  this._selectRowIndicator.redraw();
846
825
  }
847
826
 
848
- onFeatureCellResize(event: SdResizeEvent, key: number): void {
827
+ onFixedCellResize(event: SdResizeEvent, key: number): void {
849
828
  if (!event.widthChanged) return;
850
829
  const width = event.target.offsetWidth;
851
- this._featureCellWidths.update((m) => {
830
+ this._fixedCellWidths.update((m) => {
852
831
  const newMap = new Map(m);
853
832
  newMap.set(key, width);
854
833
  return newMap;
@@ -923,7 +902,7 @@ export class SdSheet<T> {
923
902
  type: SdSheetConfigModal,
924
903
  inputs: {
925
904
  sheetKey: this.key()!,
926
- controls: this.columnControls(),
905
+ controls: this._effectiveColumnControls(),
927
906
  config: this._configResource.value(),
928
907
  },
929
908
  });
@@ -18,6 +18,7 @@ export interface SdSheetHeaderDef {
18
18
  rowspan: number;
19
19
  isLastRow: boolean;
20
20
  colDef: SdSheetColumnDef | undefined;
21
+ colIndex: number;
21
22
  }
22
23
 
23
24
  export interface SdSheetConfig {
@@ -4,7 +4,7 @@ import type { ExpandItemDef } from "../../core/selection/useExpandingManager";
4
4
 
5
5
  export function useSheetCellStyling<T>(options: {
6
6
  columnDefs: Signal<SdSheetColumnDef[]>;
7
- fixedLeftMap: Signal<Map<string, number>>;
7
+ fixedLeftMap: Signal<Map<number, number>>;
8
8
  getItemCellStyleFn: Signal<((item: T, colKey: string) => string | undefined) | undefined>;
9
9
  getItemCellClassFn: Signal<((item: T, colKey: string) => string) | undefined>;
10
10
  getChildrenFn: Signal<((item: T, index: number) => T[] | undefined) | undefined>;
@@ -21,8 +21,8 @@ export function useSheetCellStyling<T>(options: {
21
21
  return null;
22
22
  }
23
23
 
24
- function getFixedStyle(colDef: SdSheetColumnDef): string | null {
25
- const leftValue = options.fixedLeftMap().get(colDef.key);
24
+ function getFixedLeftStyle(colIdx: number): string | null {
25
+ const leftValue = options.fixedLeftMap().get(colIdx);
26
26
  if (leftValue == null) return null;
27
27
 
28
28
  return `left: ${leftValue}px`;
@@ -30,12 +30,16 @@ export function useSheetCellStyling<T>(options: {
30
30
 
31
31
  const headerColumnStyles = computed(() => {
32
32
  const map = new Map<string, string | null>();
33
- for (const colDef of options.columnDefs()) {
33
+ const defs = options.columnDefs();
34
+ for (let i = 0; i < defs.length; i++) {
35
+ const colDef = defs[i];
34
36
  const parts: string[] = [];
35
37
  const colStyle = getColDefStyle(colDef);
36
38
  if (colStyle != null) parts.push(colStyle);
37
- const fixedStyle = getFixedStyle(colDef);
38
- if (fixedStyle != null) parts.push(fixedStyle);
39
+ if (colDef.fixed) {
40
+ const fixedStyle = getFixedLeftStyle(i);
41
+ if (fixedStyle != null) parts.push(fixedStyle);
42
+ }
39
43
  map.set(colDef.key, parts.length > 0 ? parts.join("; ") : null);
40
44
  }
41
45
  return map;
@@ -43,12 +47,16 @@ export function useSheetCellStyling<T>(options: {
43
47
 
44
48
  const dataColumnBaseStyles = computed(() => {
45
49
  const map = new Map<string, string | null>();
46
- for (const colDef of options.columnDefs()) {
50
+ const defs = options.columnDefs();
51
+ for (let i = 0; i < defs.length; i++) {
52
+ const colDef = defs[i];
47
53
  const parts: string[] = [];
48
54
  const colStyle = getColDefStyle(colDef);
49
55
  if (colStyle != null) parts.push(colStyle);
50
- const fixedStyle = getFixedStyle(colDef);
51
- if (fixedStyle != null) parts.push(fixedStyle);
56
+ if (colDef.fixed) {
57
+ const fixedStyle = getFixedLeftStyle(i);
58
+ if (fixedStyle != null) parts.push(fixedStyle);
59
+ }
52
60
  map.set(colDef.key, parts.length > 0 ? parts.join("; ") : null);
53
61
  }
54
62
  return map;
@@ -71,8 +79,8 @@ export function useSheetCellStyling<T>(options: {
71
79
  return customStyle ?? baseStyle ?? null;
72
80
  }
73
81
 
74
- function getFixedCellStyle(colDef: SdSheetColumnDef): string | null {
75
- return getFixedStyle(colDef);
82
+ function getFixedCellStyle(colIdx: number): string | null {
83
+ return getFixedLeftStyle(colIdx);
76
84
  }
77
85
 
78
86
  function getCellStyleWithIndent(item: T, colDef: SdSheetColumnDef, colIdx: number): string | null {