frontile 0.18.0-beta.4 → 0.18.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.
Files changed (83) hide show
  1. package/declarations/components/collections/dropdown/menu-context.d.ts +10 -0
  2. package/declarations/components/collections/dropdown/menu-context.d.ts.map +1 -1
  3. package/declarations/components/collections/dropdown/sub.d.ts +34 -0
  4. package/declarations/components/collections/dropdown/sub.d.ts.map +1 -1
  5. package/declarations/components/collections/table/cell-default.d.ts.map +1 -1
  6. package/declarations/components/collections/table/index.d.ts.map +1 -1
  7. package/declarations/components/collections/table/table.d.ts.map +1 -1
  8. package/declarations/components/collections/table/types.d.ts.map +1 -1
  9. package/declarations/components/collections/table/utils.d.ts.map +1 -1
  10. package/declarations/components/forms/field.d.ts.map +1 -1
  11. package/declarations/components/forms/form.d.ts.map +1 -1
  12. package/declarations/components/forms/native-select.d.ts.map +1 -1
  13. package/declarations/components/forms/select/select.d.ts +4 -76
  14. package/declarations/components/forms/select/select.d.ts.map +1 -1
  15. package/declarations/components/forms/select/types.d.ts.map +1 -1
  16. package/declarations/components/navigation/breadcrumbs/breadcrumbs.d.ts +251 -0
  17. package/declarations/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  18. package/declarations/components/navigation/breadcrumbs/collapse.d.ts +52 -0
  19. package/declarations/components/navigation/breadcrumbs/collapse.d.ts.map +1 -0
  20. package/declarations/components/navigation/breadcrumbs/ellipsis.d.ts +56 -0
  21. package/declarations/components/navigation/breadcrumbs/ellipsis.d.ts.map +1 -0
  22. package/declarations/components/navigation/breadcrumbs/item.d.ts +100 -0
  23. package/declarations/components/navigation/breadcrumbs/item.d.ts.map +1 -0
  24. package/declarations/components/navigation/breadcrumbs/separator.d.ts +27 -0
  25. package/declarations/components/navigation/breadcrumbs/separator.d.ts.map +1 -0
  26. package/declarations/components/navigation/breadcrumbs.d.ts +6 -0
  27. package/declarations/components/navigation/breadcrumbs.d.ts.map +1 -0
  28. package/declarations/components/navigation/index.d.ts +1 -0
  29. package/declarations/components/navigation/index.d.ts.map +1 -1
  30. package/declarations/components/overlays/overlay.d.ts.map +1 -1
  31. package/declarations/components/overlays/tooltip.d.ts +18 -19
  32. package/declarations/components/overlays/tooltip.d.ts.map +1 -1
  33. package/declarations/components/status/progress-bar.d.ts.map +1 -1
  34. package/declarations/components/utilities/collapsible.d.ts.map +1 -1
  35. package/declarations/utils/deferred-work.d.ts +4 -1
  36. package/declarations/utils/deferred-work.d.ts.map +1 -1
  37. package/dist/components/collections/dropdown/menu-context.js.map +1 -1
  38. package/dist/components/collections/dropdown/sub.js +78 -13
  39. package/dist/components/collections/dropdown/sub.js.map +1 -1
  40. package/dist/components/collections/simple-table/index.js.map +1 -1
  41. package/dist/components/collections/table/cell-default.js +0 -2
  42. package/dist/components/collections/table/cell-default.js.map +1 -1
  43. package/dist/components/collections/table/table.js +4 -46
  44. package/dist/components/collections/table/table.js.map +1 -1
  45. package/dist/components/collections/table/utils.js +0 -2
  46. package/dist/components/collections/table/utils.js.map +1 -1
  47. package/dist/components/forms/field.js +0 -1
  48. package/dist/components/forms/field.js.map +1 -1
  49. package/dist/components/forms/form.js +1 -39
  50. package/dist/components/forms/form.js.map +1 -1
  51. package/dist/components/forms/native-select.js +0 -3
  52. package/dist/components/forms/native-select.js.map +1 -1
  53. package/dist/components/forms/select/select.js +9 -116
  54. package/dist/components/forms/select/select.js.map +1 -1
  55. package/dist/components/navigation/breadcrumbs/breadcrumbs.js +208 -0
  56. package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -0
  57. package/dist/components/navigation/breadcrumbs/collapse.js +49 -0
  58. package/dist/components/navigation/breadcrumbs/collapse.js.map +1 -0
  59. package/dist/components/navigation/breadcrumbs/ellipsis.js +40 -0
  60. package/dist/components/navigation/breadcrumbs/ellipsis.js.map +1 -0
  61. package/dist/components/navigation/breadcrumbs/item.js +102 -0
  62. package/dist/components/navigation/breadcrumbs/item.js.map +1 -0
  63. package/dist/components/navigation/breadcrumbs/separator.js +24 -0
  64. package/dist/components/navigation/breadcrumbs/separator.js.map +1 -0
  65. package/dist/components/navigation/breadcrumbs.js +4 -0
  66. package/dist/components/navigation/breadcrumbs.js.map +1 -0
  67. package/dist/components/navigation/index.js +3 -0
  68. package/dist/components/navigation/index.js.map +1 -1
  69. package/dist/components/overlays/overlay.js +0 -1
  70. package/dist/components/overlays/overlay.js.map +1 -1
  71. package/dist/components/overlays/tooltip.js +19 -21
  72. package/dist/components/overlays/tooltip.js.map +1 -1
  73. package/dist/components/status/progress-bar.js +0 -3
  74. package/dist/components/status/progress-bar.js.map +1 -1
  75. package/dist/components/utilities/collapsible.js +2 -4
  76. package/dist/components/utilities/collapsible.js.map +1 -1
  77. package/dist/index.js +3 -0
  78. package/dist/index.js.map +1 -1
  79. package/dist/navigation.js +3 -0
  80. package/dist/navigation.js.map +1 -1
  81. package/dist/utils/deferred-work.js +27 -2
  82. package/dist/utils/deferred-work.js.map +1 -1
  83. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/components/status/progress-bar.gts"],"names":[],"mappings":"AA6RA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,UAAU,oBAAoB;IAC5B,IAAI,EAAE;QACJ;;WAEG;QACH,KAAK,CAAC,EACF,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;QAEb;;WAEG;QACH,MAAM,CAAC,EACH,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;QAEb;;WAEG;QACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;QAEjC;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAA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oBAAoB,CAAC;IACvD,EAAE,SAAiB;IAEnB,IAAI,UAAU;;;;;MA2Bb;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CASvB;IAED,IAAI,cAAc,IAAI,OAAO,CAM5B;IAED,IAAI,mBAAmB,IAAI,MAAM,CA+BhC;IAED;;;;;;;;;OASG;IACH,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAMrC;IAED,IAAI,aAAa,IAAI,UAAU,CAM9B;CAkGF;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,oBAAoB,EAAE,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/utilities/collapsible.gts"],"names":[],"mappings":"AAmSA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAqCtC,UAAU,eAAe;IACvB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,oBAAoB;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,cAAM,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACvD,eAAe,UAAS;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,UAAS;gBAEZ,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe;IAS/C;;;;OAIG;IACH,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;I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,IAAI,MAAM,GAAG,SAAS,CAEtC;IAED,IAAI,MAAM,IAAI,UAAU,CAAC,OAAO,UAAU,CAAC,CAoB1C;IAED,cAAc,UAAS;IACvB,MAAM;;;;;;OAmBH;IAEH,SAAS,IAAI,IAAI;IASjB,WAAW,IAAI,IAAI;IAMnB,eAAe,GAAI,OAAO,eAAe,UAmCvC;IAEF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI1C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI3C,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAmClC;;;;;;;OAOG;IACH,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAS5C,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;CA2CrC;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,oBAAoB,EAAE,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -11,7 +11,10 @@ type When = 'frame' | 'microtask';
11
11
  */
12
12
  declare class DeferredWork {
13
13
  #private;
14
- /** @param label the test-waiter name, which must be unique per instance. */
14
+ /**
15
+ * @param label the test-waiter name. Instances may share one; see
16
+ * `waiterFor`.
17
+ */
15
18
  constructor(label: string);
16
19
  get isPending(): boolean;
17
20
  /** Queues `run`, unless something is already queued. */
@@ -1 +1 @@
1
- {"version":3,"file":"deferred-work.d.ts","sourceRoot":"","sources":["../../src/utils/deferred-work.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG,OAAO,GAAG,WAAW,CAAC;AAElC;;;;;;;;;GASG;AACH,cAAM,YAAY;;IAKhB,4EAA4E;gBAChE,KAAK,EAAE,MAAM;IAIzB,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,IAAc,GAAG,IAAI;IA4BrD,4DAA4D;IAC5D,MAAM,IAAI,IAAI;CASf;AAED,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEjD;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"deferred-work.d.ts","sourceRoot":"","sources":["../../src/utils/deferred-work.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG,OAAO,GAAG,WAAW,CAAC;AA2BlC;;;;;;;;;GASG;AACH,cAAM,YAAY;;IAKhB;;;OAGG;gBACS,KAAK,EAAE,MAAM;IAIzB,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,IAAc,GAAG,IAAI;IA4BrD,4DAA4D;IAC5D,MAAM,IAAI,IAAI;CASf;AAED,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEjD;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-context.js","sources":["../../../../src/components/collections/dropdown/menu-context.ts"],"sourcesContent":["import type { SelectionMode } from '../../../utils/listManager';\nimport type { ListboxItemSignature } from '../listbox/item';\n\n/**\n * How a submenu was asked to open.\n *\n * It decides whether the submenu highlights its first item: a keyboard user\n * who pressed ArrowRight expects to be somewhere, while a pointer user\n * hovering a row does not expect a selection to move. The `Listbox` at each\n * level is constructed fresh on open, so the source is read once, at mount,\n * as `autoActivateMode`.\n */\ntype OpenSource = 'pointer' | 'keyboard';\n\n/**\n * What a level needs in order to drive a submenu it does not itself render.\n *\n * A level's ArrowRight handler has to open the submenu belonging to whichever\n * item is currently active. The item knows nothing about the submenu, and the\n * `Sub` renders inside the level's own block -- so each `Sub` registers a\n * handle under its trigger's key, and the level looks it up.\n */\ninterface SubHandle {\n open: (source: OpenSource) => void;\n close: () => void;\n}\n\ninterface MenuContext extends MenuSelectionContext {\n /** 0 for the root menu, 1 for a submenu, and so on. */\n depth: number;\n\n /**\n * Close the whole chain. Choosing a leaf three levels down dismisses the\n * entire dropdown, not just the level the leaf sits in.\n */\n closeRoot: () => void;\n\n /**\n * Close just this level, leaving its parent open -- what ArrowLeft does.\n * On the root this is the same thing as `closeRoot`.\n */\n closeSelf: () => void;\n\n /** The submenus registered at this level, keyed by their trigger's key. */\n subs: Map<string, SubHandle>;\n registerSub: (key: string, handle: SubHandle) => void;\n unregisterSub: (key: string) => void;\n\n // Appearance and timing are the root's for the whole chain: a submenu that\n // styled itself would make one menu look like two, so these are declared\n // once on the root and never overridden below it.\n variant?: ListboxItemSignature['Args']['variant'];\n color?: ListboxItemSignature['Args']['color'];\n shortcutVariant?: ListboxItemSignature['Args']['shortcutVariant'];\n disableTransitions?: boolean;\n transitionDuration?: number;\n}\n\n/**\n * The parts of a context a level may declare for itself.\n *\n * Declared once on the root and inherited by every depth -- so `@onAction` and\n * `@selectedKeys` written at the top apply to a leaf at any level -- but a\n * submenu may override any of them for its own level and the levels below,\n * which is what lets a navigation menu hold a multi-select submenu.\n *\n * Split out from `MenuContext` so the overridable set is a type rather than a\n * list repeated in prose and in a literal: `OVERRIDABLE_KEYS` below is indexed\n * by this interface, so an eighth setting added here fails to compile until it\n * is spelled there too, instead of silently being non-overridable.\n */\ninterface MenuSelectionContext {\n selectionMode?: SelectionMode;\n selectedKeys?: string[];\n disabledKeys?: string[];\n allowEmpty?: boolean;\n onAction?: (key: string) => void;\n onSelectionChange?: (keys: string[]) => void;\n closeOnItemSelect?: boolean;\n}\n\nconst OVERRIDABLE_KEYS: Record<keyof MenuSelectionContext, true> = {\n selectionMode: true,\n selectedKeys: true,\n disabledKeys: true,\n allowEmpty: true,\n onAction: true,\n onSelectionChange: true,\n closeOnItemSelect: true\n};\n\ninterface RootMenuContextArgs extends Omit<\n MenuContext,\n 'depth' | 'closeRoot' | 'closeSelf' | 'registerSub' | 'unregisterSub'\n> {\n /** The root popover's close, used for both `closeRoot` and `closeSelf`. */\n close: () => void;\n}\n\n/**\n * `subs` is passed in rather than created here, and deliberately so: the\n * caller is a Glimmer component whose getter rebuilds this object on every\n * render, and a map created here would drop every `Sub` that had already\n * registered. The component owns one stable map for the life of the level.\n */\nfunction bindSubRegistry(\n subs: Map<string, SubHandle>\n): Pick<MenuContext, 'registerSub' | 'unregisterSub'> {\n return {\n registerSub: (key, handle) => subs.set(key, handle),\n unregisterSub: (key) => subs.delete(key)\n };\n}\n\nfunction createRootMenuContext(args: RootMenuContextArgs): MenuContext {\n const { close, subs, ...shared } = args;\n\n return {\n ...shared,\n depth: 0,\n subs,\n closeRoot: close,\n closeSelf: close,\n ...bindSubRegistry(subs)\n };\n}\n\nfunction createChildMenuContext(\n parent: MenuContext,\n options: { closeSelf: () => void; subs: Map<string, SubHandle> }\n): MenuContext {\n const { closeSelf, subs } = options;\n\n return {\n ...parent,\n depth: parent.depth + 1,\n subs,\n closeSelf,\n ...bindSubRegistry(subs)\n };\n}\n\n/**\n * Layers a level's own declarations over the context it inherited.\n *\n * Only settings actually written on this level count: reading them\n * unconditionally would overwrite inherited values with `undefined` and\n * silently break inheritance, which is the default and by far the common case.\n * That case also allocates nothing and hands back the parent's own object, so\n * a level that declares nothing is indistinguishable downstream from one that\n * never had the chance to.\n */\nfunction createOverriddenMenuContext(\n parent: MenuContext,\n own: MenuSelectionContext\n): MenuContext {\n let overrides: Partial<MenuSelectionContext> | undefined;\n\n for (const key of Object.keys(\n OVERRIDABLE_KEYS\n ) as (keyof MenuSelectionContext)[]) {\n const value = own[key];\n\n if (value !== undefined) {\n overrides ??= {};\n // Correlating the key with its own value type is beyond what TS narrows\n // across an index like this; the `Record` above is what actually keeps\n // the key set honest.\n overrides[key] = value as never;\n }\n }\n\n return overrides ? { ...parent, ...overrides } : parent;\n}\n\nexport {\n createRootMenuContext,\n createChildMenuContext,\n createOverriddenMenuContext,\n type MenuContext,\n type MenuSelectionContext,\n type RootMenuContextArgs,\n type SubHandle,\n type OpenSource\n};\n"],"names":["OVERRIDABLE_KEYS","selectionMode","selectedKeys","disabledKeys","allowEmpty","onAction","onSelectionChange","closeOnItemSelect","bindSubRegistry","subs","registerSub","key","handle","set","unregisterSub","delete","createRootMenuContext","args","close","shared","depth","closeRoot","closeSelf","createChildMenuContext","parent","options","createOverriddenMenuContext","own","overrides","Object","keys","value","undefined"],"mappings":"AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,MAAMA,gBAA0D,GAAG;AACjEC,EAAAA,aAAa,EAAE,IAAI;AACnBC,EAAAA,YAAY,EAAE,IAAI;AAClBC,EAAAA,YAAY,EAAE,IAAI;AAClBC,EAAAA,UAAU,EAAE,IAAI;AAChBC,EAAAA,QAAQ,EAAE,IAAI;AACdC,EAAAA,iBAAiB,EAAE,IAAI;AACvBC,EAAAA,iBAAiB,EAAE;AACrB,CAAC;AAUD;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CACtBC,IAA4B,EACwB;EACpD,OAAO;AACLC,IAAAA,WAAW,EAAEA,CAACC,GAAG,EAAEC,MAAM,KAAKH,IAAI,CAACI,GAAG,CAACF,GAAG,EAAEC,MAAM,CAAC;AACnDE,IAAAA,aAAa,EAAGH,GAAG,IAAKF,IAAI,CAACM,MAAM,CAACJ,GAAG;GACxC;AACH;AAEA,SAASK,qBAAqBA,CAACC,IAAyB,EAAe;EACrE,MAAM;IAAEC,KAAK;IAAET,IAAI;IAAE,GAAGU;AAAO,GAAC,GAAGF,IAAI;EAEvC,OAAO;AACL,IAAA,GAAGE,MAAM;AACTC,IAAAA,KAAK,EAAE,CAAC;IACRX,IAAI;AACJY,IAAAA,SAAS,EAAEH,KAAK;AAChBI,IAAAA,SAAS,EAAEJ,KAAK;IAChB,GAAGV,eAAe,CAACC,IAAI;GACxB;AACH;AAEA,SAASc,sBAAsBA,CAC7BC,MAAmB,EACnBC,OAAgE,EACnD;EACb,MAAM;IAAEH,SAAS;AAAEb,IAAAA;AAAK,GAAC,GAAGgB,OAAO;EAEnC,OAAO;AACL,IAAA,GAAGD,MAAM;AACTJ,IAAAA,KAAK,EAAEI,MAAM,CAACJ,KAAK,GAAG,CAAC;IACvBX,IAAI;IACJa,SAAS;IACT,GAAGd,eAAe,CAACC,IAAI;GACxB;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASiB,2BAA2BA,CAClCF,MAAmB,EACnBG,GAAyB,EACZ;AACb,EAAA,IAAIC,SAAoD;EAExD,KAAK,MAAMjB,GAAG,IAAIkB,MAAM,CAACC,IAAI,CAC3B9B,gBACF,CAAC,EAAoC;AACnC,IAAA,MAAM+B,KAAK,GAAGJ,GAAG,CAAChB,GAAG,CAAC;IAEtB,IAAIoB,KAAK,KAAKC,SAAS,EAAE;MACvBJ,SAAS,KAAK,EAAE;AAChB;AACA;AACA;AACAA,MAAAA,SAAS,CAACjB,GAAG,CAAC,GAAGoB,KAAc;AACjC,IAAA;AACF,EAAA;AAEA,EAAA,OAAOH,SAAS,GAAG;AAAE,IAAA,GAAGJ,MAAM;IAAE,GAAGI;AAAU,GAAC,GAAGJ,MAAM;AACzD;;"}
1
+ {"version":3,"file":"menu-context.js","sources":["../../../../src/components/collections/dropdown/menu-context.ts"],"sourcesContent":["import type { SelectionMode } from '../../../utils/listManager';\nimport type { Point } from '../../../utils/safe-area';\nimport type { ListboxItemSignature } from '../listbox/item';\n\n/**\n * How a submenu was asked to open.\n *\n * It decides whether the submenu highlights its first item: a keyboard user\n * who pressed ArrowRight expects to be somewhere, while a pointer user\n * hovering a row does not expect a selection to move. The `Listbox` at each\n * level is constructed fresh on open, so the source is read once, at mount,\n * as `autoActivateMode`.\n */\ntype OpenSource = 'pointer' | 'keyboard';\n\n/**\n * What a level needs in order to drive a submenu it does not itself render.\n *\n * A level's ArrowRight handler has to open the submenu belonging to whichever\n * item is currently active. The item knows nothing about the submenu, and the\n * `Sub` renders inside the level's own block -- so each `Sub` registers a\n * handle under its trigger's key, and the level looks it up.\n */\ninterface SubHandle {\n open: (source: OpenSource) => void;\n close: () => void;\n\n /**\n * Whether this submenu is open and the pointer is somewhere that should\n * keep it that way -- its own safe area, or one of its own descendants'.\n *\n * A level asks this of its children before closing itself. A third level\n * sits outside the second level's safe area entirely, so without it the\n * whole chain unwinds the moment the pointer goes deeper than one level.\n */\n isPointSafe: (point: Point) => boolean;\n}\n\ninterface MenuContext extends MenuSelectionContext {\n /** 0 for the root menu, 1 for a submenu, and so on. */\n depth: number;\n\n /**\n * Close the whole chain. Choosing a leaf three levels down dismisses the\n * entire dropdown, not just the level the leaf sits in.\n */\n closeRoot: () => void;\n\n /**\n * Close just this level, leaving its parent open -- what ArrowLeft does.\n * On the root this is the same thing as `closeRoot`.\n */\n closeSelf: () => void;\n\n /** The submenus registered at this level, keyed by their trigger's key. */\n subs: Map<string, SubHandle>;\n registerSub: (key: string, handle: SubHandle) => void;\n unregisterSub: (key: string) => void;\n\n // Appearance and timing are the root's for the whole chain: a submenu that\n // styled itself would make one menu look like two, so these are declared\n // once on the root and never overridden below it.\n variant?: ListboxItemSignature['Args']['variant'];\n color?: ListboxItemSignature['Args']['color'];\n shortcutVariant?: ListboxItemSignature['Args']['shortcutVariant'];\n disableTransitions?: boolean;\n transitionDuration?: number;\n}\n\n/**\n * The parts of a context a level may declare for itself.\n *\n * Declared once on the root and inherited by every depth -- so `@onAction` and\n * `@selectedKeys` written at the top apply to a leaf at any level -- but a\n * submenu may override any of them for its own level and the levels below,\n * which is what lets a navigation menu hold a multi-select submenu.\n *\n * Split out from `MenuContext` so the overridable set is a type rather than a\n * list repeated in prose and in a literal: `OVERRIDABLE_KEYS` below is indexed\n * by this interface, so an eighth setting added here fails to compile until it\n * is spelled there too, instead of silently being non-overridable.\n */\ninterface MenuSelectionContext {\n selectionMode?: SelectionMode;\n selectedKeys?: string[];\n disabledKeys?: string[];\n allowEmpty?: boolean;\n onAction?: (key: string) => void;\n onSelectionChange?: (keys: string[]) => void;\n closeOnItemSelect?: boolean;\n}\n\nconst OVERRIDABLE_KEYS: Record<keyof MenuSelectionContext, true> = {\n selectionMode: true,\n selectedKeys: true,\n disabledKeys: true,\n allowEmpty: true,\n onAction: true,\n onSelectionChange: true,\n closeOnItemSelect: true\n};\n\ninterface RootMenuContextArgs extends Omit<\n MenuContext,\n 'depth' | 'closeRoot' | 'closeSelf' | 'registerSub' | 'unregisterSub'\n> {\n /** The root popover's close, used for both `closeRoot` and `closeSelf`. */\n close: () => void;\n}\n\n/**\n * `subs` is passed in rather than created here, and deliberately so: the\n * caller is a Glimmer component whose getter rebuilds this object on every\n * render, and a map created here would drop every `Sub` that had already\n * registered. The component owns one stable map for the life of the level.\n */\nfunction bindSubRegistry(\n subs: Map<string, SubHandle>\n): Pick<MenuContext, 'registerSub' | 'unregisterSub'> {\n return {\n registerSub: (key, handle) => subs.set(key, handle),\n unregisterSub: (key) => subs.delete(key)\n };\n}\n\nfunction createRootMenuContext(args: RootMenuContextArgs): MenuContext {\n const { close, subs, ...shared } = args;\n\n return {\n ...shared,\n depth: 0,\n subs,\n closeRoot: close,\n closeSelf: close,\n ...bindSubRegistry(subs)\n };\n}\n\nfunction createChildMenuContext(\n parent: MenuContext,\n options: { closeSelf: () => void; subs: Map<string, SubHandle> }\n): MenuContext {\n const { closeSelf, subs } = options;\n\n return {\n ...parent,\n depth: parent.depth + 1,\n subs,\n closeSelf,\n ...bindSubRegistry(subs)\n };\n}\n\n/**\n * Layers a level's own declarations over the context it inherited.\n *\n * Only settings actually written on this level count: reading them\n * unconditionally would overwrite inherited values with `undefined` and\n * silently break inheritance, which is the default and by far the common case.\n * That case also allocates nothing and hands back the parent's own object, so\n * a level that declares nothing is indistinguishable downstream from one that\n * never had the chance to.\n */\nfunction createOverriddenMenuContext(\n parent: MenuContext,\n own: MenuSelectionContext\n): MenuContext {\n let overrides: Partial<MenuSelectionContext> | undefined;\n\n for (const key of Object.keys(\n OVERRIDABLE_KEYS\n ) as (keyof MenuSelectionContext)[]) {\n const value = own[key];\n\n if (value !== undefined) {\n overrides ??= {};\n // Correlating the key with its own value type is beyond what TS narrows\n // across an index like this; the `Record` above is what actually keeps\n // the key set honest.\n overrides[key] = value as never;\n }\n }\n\n return overrides ? { ...parent, ...overrides } : parent;\n}\n\nexport {\n createRootMenuContext,\n createChildMenuContext,\n createOverriddenMenuContext,\n type MenuContext,\n type MenuSelectionContext,\n type RootMenuContextArgs,\n type SubHandle,\n type OpenSource\n};\n"],"names":["OVERRIDABLE_KEYS","selectionMode","selectedKeys","disabledKeys","allowEmpty","onAction","onSelectionChange","closeOnItemSelect","bindSubRegistry","subs","registerSub","key","handle","set","unregisterSub","delete","createRootMenuContext","args","close","shared","depth","closeRoot","closeSelf","createChildMenuContext","parent","options","createOverriddenMenuContext","own","overrides","Object","keys","value","undefined"],"mappings":"AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,MAAMA,gBAA0D,GAAG;AACjEC,EAAAA,aAAa,EAAE,IAAI;AACnBC,EAAAA,YAAY,EAAE,IAAI;AAClBC,EAAAA,YAAY,EAAE,IAAI;AAClBC,EAAAA,UAAU,EAAE,IAAI;AAChBC,EAAAA,QAAQ,EAAE,IAAI;AACdC,EAAAA,iBAAiB,EAAE,IAAI;AACvBC,EAAAA,iBAAiB,EAAE;AACrB,CAAC;AAUD;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CACtBC,IAA4B,EACwB;EACpD,OAAO;AACLC,IAAAA,WAAW,EAAEA,CAACC,GAAG,EAAEC,MAAM,KAAKH,IAAI,CAACI,GAAG,CAACF,GAAG,EAAEC,MAAM,CAAC;AACnDE,IAAAA,aAAa,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as initializeDeferredDecorator } from '../../..
15
15
  const SUBMENU_OPEN_DELAY = 100;
16
16
  /**
17
17
  * The pointer has to cross a gap to reach the submenu, so leaving the trigger
18
- * cannot close it instantly. Task 11's safe area decides *where* the pointer
19
- * is allowed to go; this is how long it has to get there.
18
+ * cannot close it instantly. The safe-area check below decides *where* the
19
+ * pointer is allowed to go; this is how long it has to get there.
20
20
  */
21
21
  const SUBMENU_CLOSE_DELAY = 300;
22
22
  /**
@@ -86,19 +86,43 @@ class Sub extends Component {
86
86
  this.args.parentContext.unregisterSub(this.triggerKey);
87
87
  this.stopTracking();
88
88
  cancel(this.#openTimer);
89
- cancel(this.#closeTimer);
89
+ this.cancelClose();
90
90
  }
91
91
  handle = {
92
92
  open: source => this.open(source),
93
- close: () => this.close()
93
+ close: () => this.close(),
94
+ isPointSafe: point => this.isPointSafe(point)
94
95
  };
95
96
  open = (source = 'pointer') => {
97
+ this.closeSiblings();
96
98
  this.openSource = source;
97
99
  this.isOpen = true;
98
100
  this.startTracking();
99
101
  };
102
+ /**
103
+ * Close every other submenu at this level.
104
+ *
105
+ * Two sub-triggers next to each other would otherwise both stay on screen:
106
+ * the abandoned level's own close is on a timer, and the pointer moving
107
+ * toward the new one keeps re-arming it. A level's siblings are exactly the
108
+ * other entries in the parent's registry, so closing them as this one opens
109
+ * makes the two states mutually exclusive in a single render -- there is no
110
+ * frame in which both are painted.
111
+ */
112
+ closeSiblings = () => {
113
+ for (const [key, handle] of this.args.parentContext.subs) {
114
+ if (key !== this.triggerKey) {
115
+ handle.close();
116
+ }
117
+ }
118
+ };
100
119
  close = () => {
101
120
  this.stopTracking();
121
+ // Not just bookkeeping: a close that arrives from elsewhere -- a sibling
122
+ // opening, ArrowLeft -- while a timer is pending would otherwise leave
123
+ // that timer to fire later and close a level the pointer had meanwhile
124
+ // brought back.
125
+ this.cancelClose();
102
126
  if (this.isDestroyed || this.isDestroying) {
103
127
  return;
104
128
  }
@@ -129,22 +153,50 @@ class Sub extends Component {
129
153
  * is outside the safe area, so moving onto one closes the submenu.
130
154
  */
131
155
  trackPointer = event => {
132
- const submenu = document.getElementById(this.submenuId);
133
- if (!this.#triggerEl || !submenu) {
156
+ // Nothing to measure against yet -- neither close nor cancel, just wait
157
+ // for the next move.
158
+ if (!this.#triggerEl || !document.getElementById(this.submenuId)) {
134
159
  return;
135
160
  }
136
- const trigger = this.#triggerEl.getBoundingClientRect();
137
- const content = submenu.getBoundingClientRect();
138
- const point = {
161
+ if (this.isPointSafe({
139
162
  x: event.clientX,
140
163
  y: event.clientY
141
- };
142
- if (isPointInSafeArea(point, trigger, content)) {
164
+ })) {
143
165
  this.cancelClose();
144
166
  } else {
145
167
  this.scheduleClose();
146
168
  }
147
169
  };
170
+ /**
171
+ * Whether the pointer is somewhere that should keep this level open.
172
+ *
173
+ * Its own safe area, or -- recursively -- any open descendant's. A third
174
+ * level opens to the right of the second, well outside the polygon that
175
+ * runs from *this* trigger to *this* content, so a level that only
176
+ * consulted its own area would close the instant the pointer went deeper,
177
+ * taking every level below it along. Asking the children means the chain
178
+ * survives exactly as long as the pointer is still somewhere in it.
179
+ */
180
+ isPointSafe = point => {
181
+ if (!this.isOpen) {
182
+ return false;
183
+ }
184
+ const submenu = document.getElementById(this.submenuId);
185
+ if (!this.#triggerEl || !submenu) {
186
+ return false;
187
+ }
188
+ const trigger = this.#triggerEl.getBoundingClientRect();
189
+ const content = submenu.getBoundingClientRect();
190
+ if (isPointInSafeArea(point, trigger, content)) {
191
+ return true;
192
+ }
193
+ for (const handle of this.#childSubs.values()) {
194
+ if (handle.isPointSafe(point)) {
195
+ return true;
196
+ }
197
+ }
198
+ return false;
199
+ };
148
200
  startTracking = () => {
149
201
  if (this.#isTracking) {
150
202
  return;
@@ -164,9 +216,22 @@ class Sub extends Component {
164
216
  cancel(this.#openTimer);
165
217
  this.#openTimer = later(this, () => this.open('pointer'), SUBMENU_OPEN_DELAY);
166
218
  };
219
+ /**
220
+ * Arm the close, but never re-arm one already pending.
221
+ *
222
+ * This runs from every `pointermove` that lands outside the safe area, so
223
+ * cancelling and re-scheduling here would let a pointer that simply keeps
224
+ * moving -- across a sibling row, into a sibling's submenu, anywhere on the
225
+ * page -- push the close out indefinitely and strand the level open. Once
226
+ * the pointer has left, the countdown is from that moment and nothing
227
+ * outside the safe area extends it; only `cancelClose` (the pointer coming
228
+ * back inside) stops it.
229
+ */
167
230
  scheduleClose = () => {
168
231
  cancel(this.#openTimer);
169
- cancel(this.#closeTimer);
232
+ if (this.#closeTimer) {
233
+ return;
234
+ }
170
235
  this.#closeTimer = later(this, this.close, SUBMENU_CLOSE_DELAY);
171
236
  };
172
237
  cancelClose = () => {
@@ -181,7 +246,7 @@ class Sub extends Component {
181
246
  el.removeEventListener('pointerenter', this.scheduleOpen);
182
247
  el.removeEventListener('pointerleave', this.scheduleClose);
183
248
  cancel(this.#openTimer);
184
- cancel(this.#closeTimer);
249
+ this.cancelClose();
185
250
  this.stopTracking();
186
251
  if (this.#triggerEl === el) {
187
252
  this.#triggerEl = undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"sub.js","sources":["../../../../src/components/collections/dropdown/sub.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { guidFor } from '@ember/object/internals';\nimport { assert } from '@ember/debug';\nimport { hash } from '@ember/helper';\nimport { cancel, later } from '@ember/runloop';\nimport { modifier } from 'ember-modifier';\nimport { Popover, type PopoverSignature } from '../../overlays/popover';\nimport { createChildMenuContext } from './menu-context';\nimport type { MenuContext, OpenSource, SubHandle } from './menu-context';\nimport type { ListboxItem } from '../listbox/item';\nimport type Owner from '@ember/owner';\nimport type { Timer } from '@ember/runloop';\nimport type { WithBoundArgs } from '@glint/template';\nimport type { ModifierLike } from '@glint/template';\nimport type { Menu } from './dropdown';\nimport { isPointInSafeArea, type Rect } from '../../../utils/safe-area';\n\n/**\n * Long enough that dragging the pointer across a row on its way somewhere else\n * does not flash a submenu open, short enough to feel immediate when the\n * pointer settles.\n */\nconst SUBMENU_OPEN_DELAY = 100;\n\n/**\n * The pointer has to cross a gap to reach the submenu, so leaving the trigger\n * cannot close it instantly. Task 11's safe area decides *where* the pointer\n * is allowed to go; this is how long it has to get there.\n */\nconst SUBMENU_CLOSE_DELAY = 300;\n\n/**\n * The raw, unbound `Menu` component, handed in rather than imported.\n *\n * `Menu` yields `Sub`, and a `Sub` renders a `Menu` for its own level. Passing\n * it in keeps the *runtime* import running one way -- `dropdown.gts` imports\n * `sub.gts` and nothing goes back at runtime, so there is no import cycle to\n * reason about there. This is a TYPE-only import of `Menu` from `dropdown.gts`\n * (see the `import type` above): it disappears entirely once compiled, so it\n * creates no runtime dependency and no cycle. A loose `ComponentLike<...>`\n * shape was tried first and rejected by Glint -- currying `Sub`'s own named\n * args onto a `ComponentLike` signature produced an \"excessively deep type\n * instantiation\" error, because Glint could not resolve the curried result\n * back to a concrete `Blocks` shape. Naming the real `Menu` type here (still\n * without a runtime import) keeps that resolution concrete.\n */\ntype MenuComponent = typeof Menu;\n\n/**\n * The bound-args shape `Sub` produces for its own `s.Menu` -- `Content`,\n * `context`, `depth`, `menuId`, `openSource` and `close` are all curried\n * by `Sub` itself (see the template below), so a consumer only ever supplies\n * the public args (`@selectionMode`, `@onAction`, and so on).\n */\ntype BoundMenuComponent = WithBoundArgs<\n typeof Menu,\n 'context' | 'depth' | 'menuId' | 'openSource' | 'close' | 'Content'\n>;\n\ninterface SubArgs extends Pick<\n PopoverSignature['Args'],\n | 'placement'\n | 'flipOptions'\n | 'middleware'\n | 'shiftOptions'\n | 'offsetOptions'\n | 'strategy'\n> {\n /**\n * @internal\n *\n * Named `item` rather than `Item`: Ember's template compiler treats any\n * named arg whose first letter is not lowercase (`@Item`, `@Menu`, ...) as\n * reserved and refuses to reference it inside a template -- so every named\n * arg here and on `SubTrigger` below is lowercase even though the values\n * yielded to consumers (`Trigger`, `Menu`, `Sub`) stay capitalized block\n * params, which are not subject to that rule.\n */\n item: WithBoundArgs<typeof ListboxItem, 'manager'>;\n\n /**\n * @internal\n *\n * The raw, unbound `Menu` -- `Sub` curries `Content`/`context`/`depth`/\n * `menuId`/`openSource`/`close` onto it itself (see `BoundMenuComponent`\n * above and the template below).\n */\n menu: MenuComponent;\n\n /**\n * @internal\n */\n parentContext: MenuContext;\n}\n\nexport interface SubSignature {\n Args: SubArgs;\n Blocks: {\n default: [\n {\n Trigger: WithBoundArgs<\n typeof SubTrigger,\n | 'item'\n | 'anchor'\n | 'onTriggerClick'\n | 'isOpen'\n | 'submenuId'\n | 'key'\n | 'hoverTrigger'\n >;\n Menu: BoundMenuComponent;\n isOpen: boolean;\n }\n ];\n };\n}\n\nclass Sub extends Component<SubSignature> {\n /**\n * The key the trigger registers under.\n *\n * Generated rather than asked for: a sub-trigger never selects, so its key\n * never reaches `onAction` or `selectedKeys`, and making consumers invent\n * one would be asking for a value nothing observes.\n */\n triggerKey = `${guidFor(this)}-sub-trigger`;\n\n /** The id of this submenu's `role=\"menu\"` element, for `aria-controls`. */\n submenuId = `${guidFor(this)}-submenu`;\n\n /**\n * The registry this level's own children write into. One map for the life of\n * the component -- see `createRootMenuContext` for why it cannot be built in\n * the getter.\n */\n #childSubs = new Map<string, SubHandle>();\n\n /**\n * The popover is driven in controlled mode.\n *\n * The parent level has to be able to open this submenu from its own\n * ArrowRight handler, through the registered `SubHandle` -- so the open\n * state has to live somewhere reachable from outside the Popover's block,\n * which the yielded `open`/`close` are not.\n */\n @tracked isOpen = false;\n\n /**\n * Not tracked: it is read once, when the freshly mounted `Listbox`\n * constructs its `ListManager`, and never rendered.\n */\n openSource: OpenSource = 'pointer';\n\n constructor(owner: Owner, args: SubArgs) {\n super(owner, args);\n this.args.parentContext.registerSub(this.triggerKey, this.handle);\n }\n\n willDestroy(): void {\n super.willDestroy();\n this.args.parentContext.unregisterSub(this.triggerKey);\n this.stopTracking();\n cancel(this.#openTimer);\n cancel(this.#closeTimer);\n }\n\n handle: SubHandle = {\n open: (source: OpenSource) => this.open(source),\n close: () => this.close()\n };\n\n open = (source: OpenSource = 'pointer') => {\n this.openSource = source;\n this.isOpen = true;\n this.startTracking();\n };\n\n close = () => {\n this.stopTracking();\n\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n this.isOpen = false;\n };\n\n #openTimer?: Timer;\n #closeTimer?: Timer;\n\n /**\n * The trigger element, captured by `hoverTrigger`, so the safe area can be\n * measured without querying for it.\n */\n #triggerEl?: HTMLElement;\n\n /**\n * Whether the pointer is currently being tracked against the safe area.\n * Guards against installing the document listener twice.\n */\n #isTracking = false;\n\n /**\n * Keeps the submenu open while the pointer is heading for it.\n *\n * The pointer has to cross a gap to reach a submenu, and it crosses it\n * diagonally -- so `pointerleave` on the trigger cannot mean \"close\". While\n * the submenu is open, every pointer move is tested against the safe area:\n * inside it, the pending close is cancelled; outside it, the pointer has\n * clearly gone elsewhere and the submenu closes.\n *\n * This also handles hovering a sibling row with no extra wiring: a sibling\n * is outside the safe area, so moving onto one closes the submenu.\n */\n trackPointer = (event: PointerEvent) => {\n const submenu = document.getElementById(this.submenuId);\n if (!this.#triggerEl || !submenu) {\n return;\n }\n\n const trigger: Rect = this.#triggerEl.getBoundingClientRect();\n const content: Rect = submenu.getBoundingClientRect();\n const point = { x: event.clientX, y: event.clientY };\n\n if (isPointInSafeArea(point, trigger, content)) {\n this.cancelClose();\n } else {\n this.scheduleClose();\n }\n };\n\n startTracking = () => {\n if (this.#isTracking) {\n return;\n }\n this.#isTracking = true;\n document.addEventListener('pointermove', this.trackPointer);\n };\n\n stopTracking = () => {\n if (!this.#isTracking) {\n return;\n }\n this.#isTracking = false;\n document.removeEventListener('pointermove', this.trackPointer);\n };\n\n scheduleOpen = () => {\n this.cancelClose();\n cancel(this.#openTimer);\n this.#openTimer = later(\n this,\n () => this.open('pointer'),\n SUBMENU_OPEN_DELAY\n );\n };\n\n scheduleClose = () => {\n cancel(this.#openTimer);\n cancel(this.#closeTimer);\n this.#closeTimer = later(this, this.close, SUBMENU_CLOSE_DELAY);\n };\n\n cancelClose = () => {\n cancel(this.#closeTimer);\n this.#closeTimer = undefined;\n };\n\n hoverTrigger = modifier((el: HTMLElement) => {\n this.#triggerEl = el;\n el.addEventListener('pointerenter', this.scheduleOpen);\n el.addEventListener('pointerleave', this.scheduleClose);\n\n return () => {\n el.removeEventListener('pointerenter', this.scheduleOpen);\n el.removeEventListener('pointerleave', this.scheduleClose);\n cancel(this.#openTimer);\n cancel(this.#closeTimer);\n this.stopTracking();\n if (this.#triggerEl === el) {\n this.#triggerEl = undefined;\n }\n };\n });\n\n onTriggerClick = () => {\n if (this.isOpen) {\n this.close();\n } else {\n this.open('pointer');\n }\n };\n\n setOpen = (isOpen: boolean) => {\n this.isOpen = isOpen;\n };\n\n get childContext(): MenuContext {\n return createChildMenuContext(this.args.parentContext, {\n closeSelf: this.close,\n subs: this.#childSubs\n });\n }\n\n get depth(): number {\n return this.args.parentContext.depth + 1;\n }\n\n <template>\n <Popover\n @isOpen={{this.isOpen}}\n @onOpenChange={{this.setOpen}}\n @placement={{if @placement @placement \"right-start\"}}\n @flipOptions={{@flipOptions}}\n @middleware={{@middleware}}\n @shiftOptions={{@shiftOptions}}\n @offsetOptions={{@offsetOptions}}\n @strategy={{@strategy}}\n as |p|\n >\n {{yield\n (hash\n Trigger=(component\n SubTrigger\n item=@item\n anchor=p.anchor\n onTriggerClick=this.onTriggerClick\n isOpen=this.isOpen\n submenuId=this.submenuId\n key=this.triggerKey\n hoverTrigger=this.hoverTrigger\n )\n Menu=(component\n @menu\n Content=p.Content\n context=this.childContext\n depth=this.depth\n menuId=this.submenuId\n openSource=this.openSource\n close=this.close\n )\n isOpen=this.isOpen\n )\n }}\n </Popover>\n </template>\n}\n\ninterface SubTriggerArgs {\n /**\n * @internal\n */\n item: WithBoundArgs<typeof ListboxItem, 'manager'>;\n\n /**\n * @internal\n */\n anchor: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * @internal\n */\n onTriggerClick: () => void;\n\n /**\n * @internal\n */\n isOpen: boolean;\n\n /**\n * @internal\n */\n submenuId: string;\n\n /**\n * The key this row registers under. Generated by `Sub` when omitted; accept\n * an override so a test or a consumer can address the row by `data-key`.\n */\n key?: string;\n\n /**\n * @internal\n */\n hoverTrigger: ModifierLike<{ Element: HTMLElement }>;\n}\n\nexport interface SubTriggerSignature {\n Args: SubTriggerArgs;\n Element: HTMLLIElement;\n Blocks: { default: [] };\n}\n\n/**\n * The row that opens a submenu.\n *\n * It renders the parent level's own bound `item`, so it registers with that\n * level's `ListManager` and takes part in arrow navigation, type-ahead and the\n * roving tab stop exactly like any other row -- while `@hasSubmenu` keeps it\n * from ever selecting.\n */\nclass SubTrigger extends Component<SubTriggerSignature> {\n /**\n * `Sub` always binds a generated `key` by default (see `Sub`'s\n * `Trigger=(component SubTrigger ... key=this.triggerKey)`), so this is\n * never actually missing -- but `@key` on `SubTriggerArgs` stays optional so\n * a consumer-supplied override can win, and `ListboxItem.key` needs a plain\n * `string`, not `string | undefined`.\n */\n get key(): string {\n assert(\n `Sub's item did not receive a @key -- Sub always binds a generated key by default`,\n this.args.key\n );\n\n return this.args.key;\n }\n\n <template>\n <@item\n @key={{this.key}}\n @hasSubmenu={{true}}\n @isSubmenuOpen={{@isOpen}}\n @submenuId={{@submenuId}}\n @onClick={{@onTriggerClick}}\n {{@anchor}}\n {{@hoverTrigger}}\n data-test-id=\"dropdown-submenu-trigger\"\n ...attributes\n >\n {{yield}}\n </@item>\n </template>\n}\n\nexport { Sub, SubTrigger };\n"],"names":["SUBMENU_OPEN_DELAY","SUBMENU_CLOSE_DELAY","Sub","Component","triggerKey","guidFor","submenuId","Map","g","prototype","tracked","i","openSource","constructor","owner","args","parentContext","registerSub","handle","willDestroy","unregisterSub","stopTracking","cancel","open","source","close","isOpen","startTracking","isDestroyed","isDestroying","trackPointer","event","submenu","document","getElementById","trigger","getBoundingClientRect","content","point","x","clientX","y","clientY","isPointInSafeArea","cancelClose","scheduleClose","addEventListener","removeEventListener","scheduleOpen","later","undefined","hoverTrigger","modifier","el","onTriggerClick","setOpen","childContext","createChildMenuContext","closeSelf","subs","depth","setComponentTemplate","precompileTemplate","strictMode","scope","Popover","hash","SubTrigger","key","assert"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,kBAAA,GAAqB,GAAA;AAE3B;;;;AAIC;AACD,MAAMC,mBAAA,GAAsB,GAAA;AAE5B;;;;;;;;;;;;;;AAcC;AAGD;;;;;AAKC;;AAgED,MAAMC,YAAYC,SAAA,CAAU;AAC1B;;;;;;AAMC;AACDC,EAAAA,aAAa,CAAA,EAAGC,OAAA,CAAQ,IAAI,CAAA,CAAA,YAAA,CAAe;AAE3C;AACAC,EAAAA,YAAY,CAAA,EAAGD,OAAA,CAAQ,IAAI,CAAA,CAAA,QAAA,CAAW;AAEtC;;;;AAIC;AACD,EAAA,UAAU,GAAG,IAAIE,GAAA,EAAY;AAE7B;;;;;;;AAOC;AAPD,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAQCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAiB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,OAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAA,MAAA;AAElB;;;;AAIAC,EAAAA,UAAA,GAAyB,SAAA;AAEzBC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAa,EAAE;AACvC,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;AACb,IAAA,IAAI,CAACA,IAAI,CAACC,aAAa,CAACC,WAAW,CAAC,IAAI,CAACb,UAAU,EAAE,IAAI,CAACc,MAAM,CAAA;AAClE,EAAA;AAEAC,EAAAA,WAAAA,GAAoB;IAClB,KAAK,CAACA,WAAA,EAAA;IACN,IAAI,CAACJ,IAAI,CAACC,aAAa,CAACI,aAAa,CAAC,IAAI,CAAChB,UAAU,CAAA;IACrD,IAAI,CAACiB,YAAY,EAAA;AACjBC,IAAAA,MAAA,CAAO,IAAI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,0pBAAA,EAqCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;AA8CA;;;;;;;;AAQA,MAAMA,mBAAmBhE,SAAA,CAAU;AACjC;;;;;;;EAOA,IAAIiE,GAAAA,GAAc;IAChBC,MAAA,CACE,kFAAkF,EAClF,IAAI,CAACtD,IAAI,CAACqD,GAAG,CAAA;AAGf,IAAA,OAAO,IAAI,CAACrD,IAAI,CAACqD,GAAG;AACtB,EAAA;AAEA,EAAA;IAAAP,oBAAA,CAAAC,kBAAA,CAAA,+OAAA,EAcA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"sub.js","sources":["../../../../src/components/collections/dropdown/sub.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { guidFor } from '@ember/object/internals';\nimport { assert } from '@ember/debug';\nimport { hash } from '@ember/helper';\nimport { cancel, later } from '@ember/runloop';\nimport { modifier } from 'ember-modifier';\nimport { Popover, type PopoverSignature } from '../../overlays/popover';\nimport { createChildMenuContext } from './menu-context';\nimport type { MenuContext, OpenSource, SubHandle } from './menu-context';\nimport type { ListboxItem } from '../listbox/item';\nimport type Owner from '@ember/owner';\nimport type { Timer } from '@ember/runloop';\nimport type { WithBoundArgs } from '@glint/template';\nimport type { ModifierLike } from '@glint/template';\nimport type { Menu } from './dropdown';\nimport {\n isPointInSafeArea,\n type Point,\n type Rect\n} from '../../../utils/safe-area';\n\n/**\n * Long enough that dragging the pointer across a row on its way somewhere else\n * does not flash a submenu open, short enough to feel immediate when the\n * pointer settles.\n */\nconst SUBMENU_OPEN_DELAY = 100;\n\n/**\n * The pointer has to cross a gap to reach the submenu, so leaving the trigger\n * cannot close it instantly. The safe-area check below decides *where* the\n * pointer is allowed to go; this is how long it has to get there.\n */\nconst SUBMENU_CLOSE_DELAY = 300;\n\n/**\n * The raw, unbound `Menu` component, handed in rather than imported.\n *\n * `Menu` yields `Sub`, and a `Sub` renders a `Menu` for its own level. Passing\n * it in keeps the *runtime* import running one way -- `dropdown.gts` imports\n * `sub.gts` and nothing goes back at runtime, so there is no import cycle to\n * reason about there. This is a TYPE-only import of `Menu` from `dropdown.gts`\n * (see the `import type` above): it disappears entirely once compiled, so it\n * creates no runtime dependency and no cycle. A loose `ComponentLike<...>`\n * shape was tried first and rejected by Glint -- currying `Sub`'s own named\n * args onto a `ComponentLike` signature produced an \"excessively deep type\n * instantiation\" error, because Glint could not resolve the curried result\n * back to a concrete `Blocks` shape. Naming the real `Menu` type here (still\n * without a runtime import) keeps that resolution concrete.\n */\ntype MenuComponent = typeof Menu;\n\n/**\n * The bound-args shape `Sub` produces for its own `s.Menu` -- `Content`,\n * `context`, `depth`, `menuId`, `openSource` and `close` are all curried\n * by `Sub` itself (see the template below), so a consumer only ever supplies\n * the public args (`@selectionMode`, `@onAction`, and so on).\n */\ntype BoundMenuComponent = WithBoundArgs<\n typeof Menu,\n 'context' | 'depth' | 'menuId' | 'openSource' | 'close' | 'Content'\n>;\n\ninterface SubArgs extends Pick<\n PopoverSignature['Args'],\n | 'placement'\n | 'flipOptions'\n | 'middleware'\n | 'shiftOptions'\n | 'offsetOptions'\n | 'strategy'\n> {\n /**\n * @internal\n *\n * Named `item` rather than `Item`: Ember's template compiler treats any\n * named arg whose first letter is not lowercase (`@Item`, `@Menu`, ...) as\n * reserved and refuses to reference it inside a template -- so every named\n * arg here and on `SubTrigger` below is lowercase even though the values\n * yielded to consumers (`Trigger`, `Menu`, `Sub`) stay capitalized block\n * params, which are not subject to that rule.\n */\n item: WithBoundArgs<typeof ListboxItem, 'manager'>;\n\n /**\n * @internal\n *\n * The raw, unbound `Menu` -- `Sub` curries `Content`/`context`/`depth`/\n * `menuId`/`openSource`/`close` onto it itself (see `BoundMenuComponent`\n * above and the template below).\n */\n menu: MenuComponent;\n\n /**\n * @internal\n */\n parentContext: MenuContext;\n}\n\nexport interface SubSignature {\n Args: SubArgs;\n Blocks: {\n default: [\n {\n Trigger: WithBoundArgs<\n typeof SubTrigger,\n | 'item'\n | 'anchor'\n | 'onTriggerClick'\n | 'isOpen'\n | 'submenuId'\n | 'key'\n | 'hoverTrigger'\n >;\n Menu: BoundMenuComponent;\n isOpen: boolean;\n }\n ];\n };\n}\n\nclass Sub extends Component<SubSignature> {\n /**\n * The key the trigger registers under.\n *\n * Generated rather than asked for: a sub-trigger never selects, so its key\n * never reaches `onAction` or `selectedKeys`, and making consumers invent\n * one would be asking for a value nothing observes.\n */\n triggerKey = `${guidFor(this)}-sub-trigger`;\n\n /** The id of this submenu's `role=\"menu\"` element, for `aria-controls`. */\n submenuId = `${guidFor(this)}-submenu`;\n\n /**\n * The registry this level's own children write into. One map for the life of\n * the component -- see `createRootMenuContext` for why it cannot be built in\n * the getter.\n */\n #childSubs = new Map<string, SubHandle>();\n\n /**\n * The popover is driven in controlled mode.\n *\n * The parent level has to be able to open this submenu from its own\n * ArrowRight handler, through the registered `SubHandle` -- so the open\n * state has to live somewhere reachable from outside the Popover's block,\n * which the yielded `open`/`close` are not.\n */\n @tracked isOpen = false;\n\n /**\n * Not tracked: it is read once, when the freshly mounted `Listbox`\n * constructs its `ListManager`, and never rendered.\n */\n openSource: OpenSource = 'pointer';\n\n constructor(owner: Owner, args: SubArgs) {\n super(owner, args);\n this.args.parentContext.registerSub(this.triggerKey, this.handle);\n }\n\n willDestroy(): void {\n super.willDestroy();\n this.args.parentContext.unregisterSub(this.triggerKey);\n this.stopTracking();\n cancel(this.#openTimer);\n this.cancelClose();\n }\n\n handle: SubHandle = {\n open: (source: OpenSource) => this.open(source),\n close: () => this.close(),\n isPointSafe: (point: Point) => this.isPointSafe(point)\n };\n\n open = (source: OpenSource = 'pointer') => {\n this.closeSiblings();\n this.openSource = source;\n this.isOpen = true;\n this.startTracking();\n };\n\n /**\n * Close every other submenu at this level.\n *\n * Two sub-triggers next to each other would otherwise both stay on screen:\n * the abandoned level's own close is on a timer, and the pointer moving\n * toward the new one keeps re-arming it. A level's siblings are exactly the\n * other entries in the parent's registry, so closing them as this one opens\n * makes the two states mutually exclusive in a single render -- there is no\n * frame in which both are painted.\n */\n closeSiblings = () => {\n for (const [key, handle] of this.args.parentContext.subs) {\n if (key !== this.triggerKey) {\n handle.close();\n }\n }\n };\n\n close = () => {\n this.stopTracking();\n // Not just bookkeeping: a close that arrives from elsewhere -- a sibling\n // opening, ArrowLeft -- while a timer is pending would otherwise leave\n // that timer to fire later and close a level the pointer had meanwhile\n // brought back.\n this.cancelClose();\n\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n this.isOpen = false;\n };\n\n #openTimer?: Timer;\n #closeTimer?: Timer;\n\n /**\n * The trigger element, captured by `hoverTrigger`, so the safe area can be\n * measured without querying for it.\n */\n #triggerEl?: HTMLElement;\n\n /**\n * Whether the pointer is currently being tracked against the safe area.\n * Guards against installing the document listener twice.\n */\n #isTracking = false;\n\n /**\n * Keeps the submenu open while the pointer is heading for it.\n *\n * The pointer has to cross a gap to reach a submenu, and it crosses it\n * diagonally -- so `pointerleave` on the trigger cannot mean \"close\". While\n * the submenu is open, every pointer move is tested against the safe area:\n * inside it, the pending close is cancelled; outside it, the pointer has\n * clearly gone elsewhere and the submenu closes.\n *\n * This also handles hovering a sibling row with no extra wiring: a sibling\n * is outside the safe area, so moving onto one closes the submenu.\n */\n trackPointer = (event: PointerEvent) => {\n // Nothing to measure against yet -- neither close nor cancel, just wait\n // for the next move.\n if (!this.#triggerEl || !document.getElementById(this.submenuId)) {\n return;\n }\n\n if (this.isPointSafe({ x: event.clientX, y: event.clientY })) {\n this.cancelClose();\n } else {\n this.scheduleClose();\n }\n };\n\n /**\n * Whether the pointer is somewhere that should keep this level open.\n *\n * Its own safe area, or -- recursively -- any open descendant's. A third\n * level opens to the right of the second, well outside the polygon that\n * runs from *this* trigger to *this* content, so a level that only\n * consulted its own area would close the instant the pointer went deeper,\n * taking every level below it along. Asking the children means the chain\n * survives exactly as long as the pointer is still somewhere in it.\n */\n isPointSafe = (point: Point): boolean => {\n if (!this.isOpen) {\n return false;\n }\n\n const submenu = document.getElementById(this.submenuId);\n if (!this.#triggerEl || !submenu) {\n return false;\n }\n\n const trigger: Rect = this.#triggerEl.getBoundingClientRect();\n const content: Rect = submenu.getBoundingClientRect();\n\n if (isPointInSafeArea(point, trigger, content)) {\n return true;\n }\n\n for (const handle of this.#childSubs.values()) {\n if (handle.isPointSafe(point)) {\n return true;\n }\n }\n\n return false;\n };\n\n startTracking = () => {\n if (this.#isTracking) {\n return;\n }\n this.#isTracking = true;\n document.addEventListener('pointermove', this.trackPointer);\n };\n\n stopTracking = () => {\n if (!this.#isTracking) {\n return;\n }\n this.#isTracking = false;\n document.removeEventListener('pointermove', this.trackPointer);\n };\n\n scheduleOpen = () => {\n this.cancelClose();\n cancel(this.#openTimer);\n this.#openTimer = later(\n this,\n () => this.open('pointer'),\n SUBMENU_OPEN_DELAY\n );\n };\n\n /**\n * Arm the close, but never re-arm one already pending.\n *\n * This runs from every `pointermove` that lands outside the safe area, so\n * cancelling and re-scheduling here would let a pointer that simply keeps\n * moving -- across a sibling row, into a sibling's submenu, anywhere on the\n * page -- push the close out indefinitely and strand the level open. Once\n * the pointer has left, the countdown is from that moment and nothing\n * outside the safe area extends it; only `cancelClose` (the pointer coming\n * back inside) stops it.\n */\n scheduleClose = () => {\n cancel(this.#openTimer);\n\n if (this.#closeTimer) {\n return;\n }\n\n this.#closeTimer = later(this, this.close, SUBMENU_CLOSE_DELAY);\n };\n\n cancelClose = () => {\n cancel(this.#closeTimer);\n this.#closeTimer = undefined;\n };\n\n hoverTrigger = modifier((el: HTMLElement) => {\n this.#triggerEl = el;\n el.addEventListener('pointerenter', this.scheduleOpen);\n el.addEventListener('pointerleave', this.scheduleClose);\n\n return () => {\n el.removeEventListener('pointerenter', this.scheduleOpen);\n el.removeEventListener('pointerleave', this.scheduleClose);\n cancel(this.#openTimer);\n this.cancelClose();\n this.stopTracking();\n if (this.#triggerEl === el) {\n this.#triggerEl = undefined;\n }\n };\n });\n\n onTriggerClick = () => {\n if (this.isOpen) {\n this.close();\n } else {\n this.open('pointer');\n }\n };\n\n setOpen = (isOpen: boolean) => {\n this.isOpen = isOpen;\n };\n\n get childContext(): MenuContext {\n return createChildMenuContext(this.args.parentContext, {\n closeSelf: this.close,\n subs: this.#childSubs\n });\n }\n\n get depth(): number {\n return this.args.parentContext.depth + 1;\n }\n\n <template>\n <Popover\n @isOpen={{this.isOpen}}\n @onOpenChange={{this.setOpen}}\n @placement={{if @placement @placement \"right-start\"}}\n @flipOptions={{@flipOptions}}\n @middleware={{@middleware}}\n @shiftOptions={{@shiftOptions}}\n @offsetOptions={{@offsetOptions}}\n @strategy={{@strategy}}\n as |p|\n >\n {{yield\n (hash\n Trigger=(component\n SubTrigger\n item=@item\n anchor=p.anchor\n onTriggerClick=this.onTriggerClick\n isOpen=this.isOpen\n submenuId=this.submenuId\n key=this.triggerKey\n hoverTrigger=this.hoverTrigger\n )\n Menu=(component\n @menu\n Content=p.Content\n context=this.childContext\n depth=this.depth\n menuId=this.submenuId\n openSource=this.openSource\n close=this.close\n )\n isOpen=this.isOpen\n )\n }}\n </Popover>\n </template>\n}\n\ninterface SubTriggerArgs {\n /**\n * @internal\n */\n item: WithBoundArgs<typeof ListboxItem, 'manager'>;\n\n /**\n * @internal\n */\n anchor: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * @internal\n */\n onTriggerClick: () => void;\n\n /**\n * @internal\n */\n isOpen: boolean;\n\n /**\n * @internal\n */\n submenuId: string;\n\n /**\n * The key this row registers under. Generated by `Sub` when omitted; accept\n * an override so a test or a consumer can address the row by `data-key`.\n */\n key?: string;\n\n /**\n * @internal\n */\n hoverTrigger: ModifierLike<{ Element: HTMLElement }>;\n}\n\nexport interface SubTriggerSignature {\n Args: SubTriggerArgs;\n Element: HTMLLIElement;\n Blocks: { default: [] };\n}\n\n/**\n * The row that opens a submenu.\n *\n * It renders the parent level's own bound `item`, so it registers with that\n * level's `ListManager` and takes part in arrow navigation, type-ahead and the\n * roving tab stop exactly like any other row -- while `@hasSubmenu` keeps it\n * from ever selecting.\n */\nclass SubTrigger extends Component<SubTriggerSignature> {\n /**\n * `Sub` always binds a generated `key` by default (see `Sub`'s\n * `Trigger=(component SubTrigger ... key=this.triggerKey)`), so this is\n * never actually missing -- but `@key` on `SubTriggerArgs` stays optional so\n * a consumer-supplied override can win, and `ListboxItem.key` needs a plain\n * `string`, not `string | undefined`.\n */\n get key(): string {\n assert(\n `Sub's item did not receive a @key -- Sub always binds a generated key by default`,\n this.args.key\n );\n\n return this.args.key;\n }\n\n <template>\n <@item\n @key={{this.key}}\n @hasSubmenu={{true}}\n @isSubmenuOpen={{@isOpen}}\n @submenuId={{@submenuId}}\n @onClick={{@onTriggerClick}}\n {{@anchor}}\n {{@hoverTrigger}}\n data-test-id=\"dropdown-submenu-trigger\"\n ...attributes\n >\n {{yield}}\n </@item>\n </template>\n}\n\nexport { Sub, SubTrigger };\n"],"names":["SUBMENU_OPEN_DELAY","SUBMENU_CLOSE_DELAY","Sub","Component","triggerKey","guidFor","submenuId","Map","g","prototype","tracked","i","openSource","constructor","owner","args","parentContext","registerSub","handle","willDestroy","unregisterSub","stopTracking","cancel","cancelClose","open","source","close","isPointSafe","point","closeSiblings","isOpen","startTracking","key","subs","isDestroyed","isDestroying","trackPointer","event","document","getElementById","x","clientX","y","clientY","scheduleClose","submenu","trigger","getBoundingClientRect","content","isPointInSafeArea","values","addEventListener","removeEventListener","scheduleOpen","later","undefined","hoverTrigger","modifier","el","onTriggerClick","setOpen","childContext","createChildMenuContext","closeSelf","depth","setComponentTemplate","precompileTemplate","strictMode","scope","Popover","hash","SubTrigger","assert"],"mappings":";;;;;;;;;;;;;;AA2BA,MAAMA,kBAAA,GAAqB,GAAA;AAE3B;;;;AAIC;AACD,MAAMC,mB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C,oBAAA,CAAAC,kBAAA,CAAA,+OAAA,EAcA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/collections/simple-table/index.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { SimpleTableHeader, type SimpleTableHeaderSignature } from './header';\nimport { SimpleTableBody, type SimpleTableBodySignature } from './body';\nimport { SimpleTableFooter, type SimpleTableFooterSignature } from './footer';\nimport { SimpleTableColumn, type SimpleTableColumnSignature } from './column';\nimport { SimpleTableRow, type SimpleTableRowSignature } from './row';\nimport { SimpleTableCell, type SimpleTableCellSignature } from './cell';\n\nimport type { TableVariants, TableSlots, SlotsToClasses } from '../table/types';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableSignature {\n Args: {\n /** Custom CSS classes for different table elements (wrapper, table, th, td, etc.) */\n classes?: SlotsToClasses<TableSlots>;\n /** Size variant for table cells and headers. @defaultValue 'md' */\n size?: TableVariants['size'];\n /** Table layout algorithm - 'auto' sizes columns by content, 'fixed' uses first row for sizing. @defaultValue 'auto' */\n layout?: TableVariants['layout'];\n /** Enable striped rows (alternating background colors) */\n isStriped?: TableVariants['striped'];\n /** Enable scrolling for the table container */\n isScrollable?: boolean;\n /** Whether to render the wrapper div. @defaultValue true */\n hasWrapper?: boolean;\n /** Enable loading state styling and behavior */\n isLoading?: boolean;\n /** Color variant for loading animation. @defaultValue 'default' */\n loadingColor?: TableVariants['loadingColor'];\n /** Color variant for selection highlight. @defaultValue 'primary' */\n selectionColor?: TableVariants['selectionColor'];\n /** Whether a custom loading block is provided (disables CSS loading indicator) */\n hasCustomLoading?: boolean;\n /**\n * @internal Whether this instance owns the \"table\" anatomy root\n * (`data-component=\"table\"`). Defaults to `true` for standalone/public\n * usage. `Table` sets this to `false` when it composes `SimpleTable`\n * internally, since `Table`'s own outer wrapper is already the anatomy\n * root for that combined instance -- without this, the `<table>` element\n * rendered here would be a second, nested `data-component=\"table\"`\n * inside Table's own root, breaking the one-root-per-instance contract.\n * @ignore\n */\n isRoot?: boolean;\n };\n Element: HTMLTableElement;\n Blocks: {\n default: [\n {\n Header: WithBoundArgs<\n ComponentLike<SimpleTableHeaderSignature>,\n 'styleFns' | 'classes'\n >;\n Body: WithBoundArgs<\n ComponentLike<SimpleTableBodySignature>,\n 'styleFns' | 'classes'\n >;\n Footer: WithBoundArgs<\n ComponentLike<SimpleTableFooterSignature>,\n 'styleFns' | 'classes'\n >;\n Column: WithBoundArgs<\n ComponentLike<SimpleTableColumnSignature>,\n 'styleFns'\n >;\n Row: WithBoundArgs<\n ComponentLike<SimpleTableRowSignature>,\n 'styleFns' | 'classes'\n >;\n Cell: WithBoundArgs<\n ComponentLike<SimpleTableCellSignature>,\n 'styleFns' | 'classes'\n >;\n }\n ];\n };\n}\n\nclass SimpleTable extends Component<SimpleTableSignature> {\n get hasWrapper() {\n return this.args.hasWrapper ?? true;\n }\n\n get isRoot() {\n return this.args.isRoot ?? true;\n }\n\n get styles() {\n const { table } = useStyles();\n return table({\n size: this.args.size,\n layout: this.args.layout,\n striped: this.args.isStriped,\n isScrollable: this.args.isScrollable || false,\n hasStickyHeader: false, // Will be determined by header component\n isLoading: this.args.hasCustomLoading\n ? false\n : this.args.isLoading || false,\n loadingColor: this.args.loadingColor,\n selectionColor: this.args.selectionColor\n // No `class: this.args.classes?.base` here: `table` has no `base`\n // slot (deleted -- it was never rendered by anything, see\n // packages/theme/src/components/table.ts), so passing a class here\n // was already a no-op.\n });\n }\n\n get wrapperClassNames() {\n return this.styles.wrapper({\n class: this.args.classes?.wrapper\n });\n }\n\n get tableClassNames() {\n return this.styles.table({ class: this.args.classes?.table });\n }\n\n <template>\n {{#if this.hasWrapper}}\n <div data-part=\"wrapper\" class={{this.wrapperClassNames}}>\n <table\n data-component={{if this.isRoot \"table\"}}\n data-part=\"table\"\n class={{this.tableClassNames}}\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n </div>\n {{else}}\n <table\n data-component={{if this.isRoot \"table\"}}\n data-part=\"table\"\n class={{this.tableClassNames}}\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n {{/if}}\n </template>\n}\n\nexport { SimpleTable, type SimpleTableSignature };\nexport default SimpleTable;\n"],"names":["SimpleTable","Component","hasWrapper","args","isRoot","styles","table","useStyles","size","layout","striped","isStriped","isScrollable","hasStickyHeader","isLoading","hasCustomLoading","loadingColor","selectionColor","wrapperClassNames","wrapper","class","classes","tableClassNames","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableHeader","SimpleTableBody","SimpleTableFooter","SimpleTableColumn","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;;;;;AAgFA,MAAMA,oBAAoBC,SAAA,CAAU;EAClC,IAAIC,UAAAA,GAAa;AACf,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,UAAU,IAAI,IAAA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AA;QAAAC,IAAA;QAAAC,iBAAA;QAAAC,eAAA;QAAAC,iBAAA;QAAAC,iBAAA;QAAAC,cAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/collections/simple-table/index.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { SimpleTableHeader, type SimpleTableHeaderSignature } from './header';\nimport { SimpleTableBody, type SimpleTableBodySignature } from './body';\nimport { SimpleTableFooter, type SimpleTableFooterSignature } from './footer';\nimport { SimpleTableColumn, type SimpleTableColumnSignature } from './column';\nimport { SimpleTableRow, type SimpleTableRowSignature } from './row';\nimport { SimpleTableCell, type SimpleTableCellSignature } from './cell';\n\nimport type { TableVariants, TableSlots, SlotsToClasses } from '../table/types';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableSignature {\n Args: {\n /** Custom CSS classes for different table elements (wrapper, table, th, td, etc.) */\n classes?: SlotsToClasses<TableSlots>;\n /** Size variant for table cells and headers. @defaultValue 'md' */\n size?: TableVariants['size'];\n /** Table layout algorithm - 'auto' sizes columns by content, 'fixed' uses first row for sizing. @defaultValue 'auto' */\n layout?: TableVariants['layout'];\n /** Enable striped rows (alternating background colors) */\n isStriped?: TableVariants['striped'];\n /** Enable scrolling for the table container */\n isScrollable?: boolean;\n /** Whether to render the wrapper div. @defaultValue true */\n hasWrapper?: boolean;\n /** Enable loading state styling and behavior */\n isLoading?: boolean;\n /** Color variant for loading animation. @defaultValue 'default' */\n loadingColor?: TableVariants['loadingColor'];\n /** Color variant for selection highlight. @defaultValue 'primary' */\n selectionColor?: TableVariants['selectionColor'];\n /** Whether a custom loading block is provided (disables CSS loading indicator) */\n hasCustomLoading?: boolean;\n /**\n * @internal Whether this instance owns the \"table\" anatomy root\n * (`data-component=\"table\"`). Defaults to `true` for standalone/public\n * usage. `Table` sets this to `false` when it composes `SimpleTable`\n * internally, since `Table`'s own outer wrapper is already the anatomy\n * root for that combined instance -- without this, the `<table>` element\n * rendered here would be a second, nested `data-component=\"table\"`\n * inside Table's own root, breaking the one-root-per-instance contract.\n * @ignore\n */\n isRoot?: boolean;\n };\n Element: HTMLTableElement;\n Blocks: {\n default: [\n {\n Header: WithBoundArgs<\n ComponentLike<SimpleTableHeaderSignature>,\n 'styleFns' | 'classes'\n >;\n Body: WithBoundArgs<\n ComponentLike<SimpleTableBodySignature>,\n 'styleFns' | 'classes'\n >;\n Footer: WithBoundArgs<\n ComponentLike<SimpleTableFooterSignature>,\n 'styleFns' | 'classes'\n >;\n Column: WithBoundArgs<\n ComponentLike<SimpleTableColumnSignature>,\n 'styleFns'\n >;\n Row: WithBoundArgs<\n ComponentLike<SimpleTableRowSignature>,\n 'styleFns' | 'classes'\n >;\n Cell: WithBoundArgs<\n ComponentLike<SimpleTableCellSignature>,\n 'styleFns' | 'classes'\n >;\n }\n ];\n };\n}\n\nclass SimpleTable extends Component<SimpleTableSignature> {\n get hasWrapper() {\n return this.args.hasWrapper ?? true;\n }\n\n get isRoot() {\n return this.args.isRoot ?? true;\n }\n\n get styles() {\n const { table } = useStyles();\n return table({\n size: this.args.size,\n layout: this.args.layout,\n striped: this.args.isStriped,\n isScrollable: this.args.isScrollable || false,\n hasStickyHeader: false,\n isLoading: this.args.hasCustomLoading\n ? false\n : this.args.isLoading || false,\n loadingColor: this.args.loadingColor,\n selectionColor: this.args.selectionColor\n // No `class: this.args.classes?.base` here: `table` has no `base`\n // slot (deleted -- it was never rendered by anything, see\n // packages/theme/src/components/table.ts), so passing a class here\n // was already a no-op.\n });\n }\n\n get wrapperClassNames() {\n return this.styles.wrapper({\n class: this.args.classes?.wrapper\n });\n }\n\n get tableClassNames() {\n return this.styles.table({ class: this.args.classes?.table });\n }\n\n <template>\n {{#if this.hasWrapper}}\n <div data-part=\"wrapper\" class={{this.wrapperClassNames}}>\n <table\n data-component={{if this.isRoot \"table\"}}\n data-part=\"table\"\n class={{this.tableClassNames}}\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n </div>\n {{else}}\n <table\n data-component={{if this.isRoot \"table\"}}\n data-part=\"table\"\n class={{this.tableClassNames}}\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n {{/if}}\n </template>\n}\n\nexport { SimpleTable, type SimpleTableSignature };\nexport default SimpleTable;\n"],"names":["SimpleTable","Component","hasWrapper","args","isRoot","styles","table","useStyles","size","layout","striped","isStriped","isScrollable","hasStickyHeader","isLoading","hasCustomLoading","loadingColor","selectionColor","wrapperClassNames","wrapper","class","classes","tableClassNames","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableHeader","SimpleTableBody","SimpleTableFooter","SimpleTableColumn","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;;;;;AAgFA,MAAMA,oBAAoBC,SAAA,CAAU;EAClC,IAAIC,UAAAA,GAAa;AACf,IAAA,OAAO,IAAI,CAACC,IA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AC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,iBAAA;QAAAC,eAAA;QAAAC,iBAAA;QAAAC,iBAAA;QAAAC,cAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -21,11 +21,9 @@ import { setComponentTemplate } from '@ember/component';
21
21
  class CellDefaultComponent extends Component {
22
22
  get shouldRender() {
23
23
  const currentKey = this.args.column.key;
24
- // Check explicit exclusions first
25
24
  if (this.args.except?.includes(currentKey)) {
26
25
  return false;
27
26
  }
28
- // Check if any CellForComponent has claimed this key
29
27
  return !this.args.registry.isKeyClaimed(currentKey);
30
28
  }
31
29
  static {
@@ -1 +1 @@
1
- {"version":3,"file":"cell-default.js","sources":["../../../../src/components/collections/table/cell-default.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport type { CellRenderingContext } from './cell-rendering-context';\nimport type { Column } from './types';\n\ninterface CellDefaultSignature<T> {\n Args: {\n /**\n * The Column object for the current cell\n */\n column: Column<T>;\n\n /**\n * Registry to check for claimed keys\n */\n registry: CellRenderingContext;\n\n /**\n * Optional array of keys to exclude from default rendering\n * (alternative to using the registry system)\n */\n except?: string[];\n };\n\n Blocks: {\n default: [];\n };\n}\n\n/**\n * Default/fallback rendering component for table cells. Only renders its content\n * when no CellForComponent has claimed the current column key.\n *\n * Usage:\n * ```hbs\n * <c.Default>\n * Default: {{c.value}}\n * </c.Default>\n *\n * <!-- Or with explicit exclusions -->\n * <c.Default @except={{array \"status\" \"actions\"}}>\n * {{c.value}}\n * </c.Default>\n * ```\n */\nexport default class CellDefaultComponent<T> extends Component<\n CellDefaultSignature<T>\n> {\n get shouldRender(): boolean {\n const currentKey = this.args.column.key;\n\n // Check explicit exclusions first\n if (this.args.except?.includes(currentKey)) {\n return false;\n }\n\n // Check if any CellForComponent has claimed this key\n return !this.args.registry.isKeyClaimed(currentKey);\n }\n\n <template>\n {{#if this.shouldRender}}\n {{yield}}\n {{/if}}\n </template>\n}\n"],"names":["CellDefaultComponent","Component","shouldRender","currentKey","args","column","key","except","includes","registry","isKeyClaimed","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;AA4BA;;;;;;;;;;;;;;;AAeC;AACc,MAAMA,oBAAA,SAAgCC,UAC9B;EAErB,IAAIC,YAAAA,GAAwB;IAC1B,MAAMC,aAAa,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,GAAG;AAEvC;IACA,IAAI,IAAI,CAACF,IAAI,CAACG,MAAM,EAAEC,SAASL,UAAA,CAAA,EAAa;AAC1C,MAAA,OAAO,KAAA;AACT,IAAA;AAEA;IACA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACK,QAAQ,CAACC,YAAY,CAACP,UAAA,CAAA;AAC1C,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,iDAAA,EAIA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"cell-default.js","sources":["../../../../src/components/collections/table/cell-default.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport type { CellRenderingContext } from './cell-rendering-context';\nimport type { Column } from './types';\n\ninterface CellDefaultSignature<T> {\n Args: {\n /**\n * The Column object for the current cell\n */\n column: Column<T>;\n\n /**\n * Registry to check for claimed keys\n */\n registry: CellRenderingContext;\n\n /**\n * Optional array of keys to exclude from default rendering\n * (alternative to using the registry system)\n */\n except?: string[];\n };\n\n Blocks: {\n default: [];\n };\n}\n\n/**\n * Default/fallback rendering component for table cells. Only renders its content\n * when no CellForComponent has claimed the current column key.\n *\n * Usage:\n * ```hbs\n * <c.Default>\n * Default: {{c.value}}\n * </c.Default>\n *\n * <!-- Or with explicit exclusions -->\n * <c.Default @except={{array \"status\" \"actions\"}}>\n * {{c.value}}\n * </c.Default>\n * ```\n */\nexport default class CellDefaultComponent<T> extends Component<\n CellDefaultSignature<T>\n> {\n get shouldRender(): boolean {\n const currentKey = this.args.column.key;\n\n if (this.args.except?.includes(currentKey)) {\n return false;\n }\n\n return !this.args.registry.isKeyClaimed(currentKey);\n }\n\n <template>\n {{#if this.shouldRender}}\n {{yield}}\n {{/if}}\n </template>\n}\n"],"names":["CellDefaultComponent","Component","shouldRender","currentKey","args","column","key","except","includes","registry","isKeyClaimed","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;AA4BA;;;;;;;;;;;;;;;AAeC;AACc,MAAMA,oBAAA,SAAgCC,UAC9B;EAErB,IAAIC,YAAAA,GAAwB;IAC1B,MAAMC,aAAa,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,GAAG;IAEvC,IAAI,IAAI,CAACF,IAAI,CAACG,MAAM,EAAEC,SAASL,UAAA,CAAA,EAAa;AAC1C,MAAA,OAAO,KAAA;AACT,IAAA;IAEA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACK,QAAQ,CAACC,YAAY,CAACP,UAAA,CAAA;AAC1C,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,iDAAA,EAIA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}