@gjsify/adwaita-nativescript 0.64.2-next.252 → 0.64.2-next.255

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 (143) hide show
  1. package/lib/esm/builder/index.js +1 -1
  2. package/lib/esm/builder/param-values.js +1 -0
  3. package/lib/esm/canvas2d/canvas2d-bridge.js +1 -1
  4. package/lib/esm/capabilities.js +1 -1
  5. package/lib/esm/index.js +1 -1
  6. package/lib/esm/namespace/gdk.js +1 -1
  7. package/lib/esm/namespace/gio.js +1 -1
  8. package/lib/esm/namespace/glib.js +1 -1
  9. package/lib/esm/namespace/gobject.js +1 -1
  10. package/lib/esm/namespace/gtk.js +1 -1
  11. package/lib/esm/widgets/adw-about-dialog.js +2 -1
  12. package/lib/esm/widgets/adw-action-row.js +1 -1
  13. package/lib/esm/widgets/adw-avatar.js +1 -1
  14. package/lib/esm/widgets/adw-banner.js +1 -1
  15. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  16. package/lib/esm/widgets/adw-button-content.js +1 -1
  17. package/lib/esm/widgets/adw-carousel.js +1 -1
  18. package/lib/esm/widgets/adw-combo-row.js +1 -1
  19. package/lib/esm/widgets/adw-data-grid.js +1 -1
  20. package/lib/esm/widgets/adw-dialog.js +1 -1
  21. package/lib/esm/widgets/adw-entry-row.js +1 -1
  22. package/lib/esm/widgets/adw-expander-row.js +1 -1
  23. package/lib/esm/widgets/adw-image-button.js +1 -1
  24. package/lib/esm/widgets/adw-navigation-page.js +1 -1
  25. package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
  26. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  27. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  28. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  29. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  30. package/lib/esm/widgets/adw-preferences-page.js +1 -1
  31. package/lib/esm/widgets/adw-sidebar.js +1 -1
  32. package/lib/esm/widgets/adw-slider-row.js +1 -1
  33. package/lib/esm/widgets/adw-spin-row.js +1 -1
  34. package/lib/esm/widgets/adw-spinner.js +1 -1
  35. package/lib/esm/widgets/adw-split-button.js +1 -1
  36. package/lib/esm/widgets/adw-switch-row.js +1 -1
  37. package/lib/esm/widgets/adw-tab-view.js +1 -1
  38. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  39. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  40. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  41. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  42. package/lib/esm/widgets/application.js +1 -1
  43. package/lib/esm/widgets/gtk-action-bar.js +1 -1
  44. package/lib/esm/widgets/gtk-box.js +1 -1
  45. package/lib/esm/widgets/gtk-button.js +1 -1
  46. package/lib/esm/widgets/gtk-check-button.js +1 -1
  47. package/lib/esm/widgets/gtk-drawing-area.js +1 -1
  48. package/lib/esm/widgets/gtk-drop-down.js +1 -1
  49. package/lib/esm/widgets/gtk-entry.js +1 -1
  50. package/lib/esm/widgets/gtk-grid.js +1 -1
  51. package/lib/esm/widgets/gtk-image.js +1 -1
  52. package/lib/esm/widgets/gtk-label.js +1 -1
  53. package/lib/esm/widgets/gtk-list-box.js +1 -1
  54. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  55. package/lib/esm/widgets/gtk-revealer.js +1 -1
  56. package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
  57. package/lib/esm/widgets/gtk-stack.js +1 -1
  58. package/lib/esm/widgets/gtk-text-view.js +1 -1
  59. package/lib/esm/widgets/gtk-toggle-button.js +1 -1
  60. package/lib/esm/widgets/gtk-window.js +1 -1
  61. package/lib/esm/widgets/icon-path.js +1 -1
  62. package/lib/esm/widgets/icon-render.js +1 -0
  63. package/lib/esm/widgets/icon-theme.js +1 -1
  64. package/lib/esm/widgets/index.js +1 -1
  65. package/lib/esm/widgets/signals.js +1 -1
  66. package/lib/esm/widgets/stack-page.js +1 -1
  67. package/lib/esm/widgets/view-stack-page.js +1 -1
  68. package/lib/esm/widgets/widget-layout.js +1 -1
  69. package/lib/esm/widgets/widget-mapping.js +1 -0
  70. package/lib/types/about-dialog-doors.spec.d.ts +1 -0
  71. package/lib/types/builder/index.d.ts +4 -0
  72. package/lib/types/builder/param-values.d.ts +21 -0
  73. package/lib/types/carousel-doors.spec.d.ts +1 -0
  74. package/lib/types/gio-resource.spec.d.ts +1 -0
  75. package/lib/types/gio.spec.d.ts +2 -0
  76. package/lib/types/icon-resources.spec.d.ts +2 -0
  77. package/lib/types/index.d.ts +1 -1
  78. package/lib/types/namespace/gdk.d.ts +1 -0
  79. package/lib/types/namespace/gio.d.ts +2 -0
  80. package/lib/types/namespace/glib.d.ts +2 -1
  81. package/lib/types/param-values.spec.d.ts +1 -0
  82. package/lib/types/testing/ns-core.d.mts +55 -14
  83. package/lib/types/widget-map.spec.d.ts +1 -0
  84. package/lib/types/widgets/adw-about-dialog.d.ts +32 -2
  85. package/lib/types/widgets/adw-action-row.d.ts +8 -1
  86. package/lib/types/widgets/adw-alert-dialog.d.ts +8 -1
  87. package/lib/types/widgets/adw-avatar.d.ts +8 -1
  88. package/lib/types/widgets/adw-banner.d.ts +8 -1
  89. package/lib/types/widgets/adw-bottom-sheet.d.ts +8 -1
  90. package/lib/types/widgets/adw-button-content.d.ts +8 -1
  91. package/lib/types/widgets/adw-carousel.d.ts +22 -3
  92. package/lib/types/widgets/adw-clamp.d.ts +8 -1
  93. package/lib/types/widgets/adw-combo-row.d.ts +4 -0
  94. package/lib/types/widgets/adw-data-grid.d.ts +8 -1
  95. package/lib/types/widgets/adw-header-bar.d.ts +8 -1
  96. package/lib/types/widgets/adw-image-button.d.ts +11 -2
  97. package/lib/types/widgets/adw-navigation-page.d.ts +8 -1
  98. package/lib/types/widgets/adw-navigation-view.d.ts +8 -1
  99. package/lib/types/widgets/adw-preferences-dialog.d.ts +8 -1
  100. package/lib/types/widgets/adw-preferences-group.d.ts +8 -1
  101. package/lib/types/widgets/adw-preferences-page.d.ts +8 -1
  102. package/lib/types/widgets/adw-shortcut-label.d.ts +8 -1
  103. package/lib/types/widgets/adw-sidebar.d.ts +8 -1
  104. package/lib/types/widgets/adw-slider-row.d.ts +8 -1
  105. package/lib/types/widgets/adw-spinner.d.ts +8 -1
  106. package/lib/types/widgets/adw-split-button.d.ts +8 -1
  107. package/lib/types/widgets/adw-status-page.d.ts +8 -1
  108. package/lib/types/widgets/adw-switch-row.d.ts +2 -0
  109. package/lib/types/widgets/adw-tab-view.d.ts +8 -1
  110. package/lib/types/widgets/adw-toast-overlay.d.ts +8 -1
  111. package/lib/types/widgets/adw-toggle-group.d.ts +8 -1
  112. package/lib/types/widgets/adw-toggle.d.ts +8 -1
  113. package/lib/types/widgets/adw-toolbar-view.d.ts +8 -1
  114. package/lib/types/widgets/adw-view-stack.d.ts +8 -1
  115. package/lib/types/widgets/adw-view-switcher-bar.d.ts +8 -1
  116. package/lib/types/widgets/adw-window-title.d.ts +8 -1
  117. package/lib/types/widgets/adw-wrap-box.d.ts +8 -1
  118. package/lib/types/widgets/carousel-indicator-base.d.ts +8 -1
  119. package/lib/types/widgets/gtk-action-bar.d.ts +8 -1
  120. package/lib/types/widgets/gtk-button.d.ts +11 -2
  121. package/lib/types/widgets/gtk-check-button.d.ts +10 -0
  122. package/lib/types/widgets/gtk-drop-down.d.ts +8 -1
  123. package/lib/types/widgets/gtk-entry.d.ts +8 -1
  124. package/lib/types/widgets/gtk-image.d.ts +11 -2
  125. package/lib/types/widgets/gtk-label.d.ts +8 -1
  126. package/lib/types/widgets/gtk-popover-menu.d.ts +8 -1
  127. package/lib/types/widgets/gtk-stack.d.ts +8 -1
  128. package/lib/types/widgets/gtk-text-view.d.ts +8 -1
  129. package/lib/types/widgets/icon-path.d.ts +9 -0
  130. package/lib/types/widgets/icon-render.d.ts +9 -0
  131. package/lib/types/widgets/icon-theme.d.ts +43 -40
  132. package/lib/types/widgets/index.d.ts +1 -1
  133. package/lib/types/widgets/signals.d.ts +14 -1
  134. package/lib/types/widgets/split-view-base.d.ts +8 -1
  135. package/lib/types/widgets/stack-page.d.ts +8 -1
  136. package/lib/types/widgets/styled-layout-base.d.ts +8 -1
  137. package/lib/types/widgets/view-stack-page.d.ts +8 -1
  138. package/lib/types/widgets/view-switcher-base.d.ts +8 -1
  139. package/lib/types/widgets/widget-layout.d.ts +10 -0
  140. package/lib/types/widgets/widget-mapping.d.ts +9 -0
  141. package/package.json +13 -13
  142. package/src/testing/ns-core.mts +147 -18
  143. package/src/theme/adwaita.css +13 -2
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{NsOverlaySplitViewState as n,splitViewColumns as r}from"./split-view-state.js";import{AdwSplitViewBase as i}from"./split-view-base.js";import{GridLayout as a}from"@nativescript/core";var AdwOverlaySplitView=class extends i{static GTypeName=`AdwOverlaySplitView`;_scrim=null;constructor(e){super(`adw-overlay-split-view`,`overlay`,new n),this._applyLayout(),t(this,e)}get pinSidebar(){return this._state.pinSidebar}set pinSidebar(t){let n=e(t,this.pinSidebar);this._state.setPinSidebar(!!n)}_applyLayout(){let e=r(this._state.sidebarPosition),t=this._state.sidebarPosition===`end`;if(!this._state.collapsed){this._detachScrim();let t=this._state.showSidebar;this._sidebar&&(this._sidebar.visibility=t?`visible`:`collapse`,this._sidebar.translateX=0,this._sidebar.opacity=1,a.setColumn(this._sidebar,e.sidebar),a.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth,this._sidebar.className=this._paneClassName(this._sidebar.className,!1),this._sidebar.horizontalAlignment=`stretch`),this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,t?e.content:0),a.setColumnSpan(this._content,t?1:2)),this._applyPaneFocus();return}this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2),this._scrim.visibility=this._state.shieldVisible?`visible`:`collapse`,this._scrim.opacity=+!!this._state.shieldVisible),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=t?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0),this._sidebar.visibility=this._state.showSidebar?`visible`:`collapse`,this._sidebar.translateX=this._state.showSidebar?0:this._hiddenOffset(),this._sidebar.opacity=1),this._applyPaneFocus()}_transitionSidebar(){if(!this._state.collapsed||!this._shouldAnimate()){this._applyLayout();return}this._cancelPending(),this._prepareCollapsedStructure(),this._applyPaneFocus(),this._state.showSidebar?this._animateOpen():this._animateClose()}_applyPaneFocus(){this._sidebar&&(this._sidebar.isUserInteractionEnabled=this._state.sidebarFocusable),this._content&&(this._content.isUserInteractionEnabled=this._state.contentFocusable)}_ensureScrim(){if(this._scrim)return this._scrim;let e=new a;return e.className=`adw-overlay-scrim`,e.visibility=`collapse`,e.opacity=0,e.addEventListener(`tap`,()=>this.hideSidebarPane()),this._scrim=e,e}_raiseOverlayChildren(){let e=this._ensureScrim();this._isChild(e)&&this.removeChild(e);let t=this._sidebar;t&&this._isChild(t)&&this.removeChild(t),this.addChild(e),t&&this.addChild(t)}_detachScrim(){this._scrim&&this._isChild(this._scrim)&&this.removeChild(this._scrim)}_prepareCollapsedStructure(){let e=this._state.sidebarPosition===`end`;this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2)),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=e?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0))}_animateOpen(){let e=this._scrim;e&&(e.visibility=`visible`,e.opacity=0,this._track(e.animate({opacity:1,duration:200,curve:`easeOut`})));let t=this._sidebar;t&&(t.visibility=`visible`,t.translateX=this._hiddenOffset(),t.opacity=1,this._track(t.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})))}_animateClose(){let e=this._scrim,t=this._sidebar,n=[];e&&n.push(this._track(e.animate({opacity:0,duration:200,curve:`easeIn`}))),t&&n.push(this._track(t.animate({translate:{x:this._hiddenOffset(),y:0},duration:200,curve:`easeIn`}))),Promise.all(n).then(()=>{this._state.showSidebar||(t&&(t.visibility=`collapse`),e&&(e.visibility=`collapse`))}).catch(()=>{})}_hiddenOffset(){let e=this.sidebarWidth;return this._state.sidebarPosition===`end`?e:-e}_paneClassName(e,t){return`${(e??``).split(/\s+/).filter(e=>e&&e!==`adw-overlay-active`&&e!==`adw-split-view-sidebar`).join(` `)} adw-split-view-sidebar${t?` adw-overlay-active`:``}`.trim()}};export{AdwOverlaySplitView};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{NsOverlaySplitViewState as n,splitViewColumns as r}from"./split-view-state.js";import{AdwSplitViewBase as i}from"./split-view-base.js";import{GridLayout as a}from"@nativescript/core";var AdwOverlaySplitView=class extends i{static GTypeName=`AdwOverlaySplitView`;_scrim=null;constructor(t){super(`adw-overlay-split-view`,`overlay`,new n),this._applyLayout(),e(this,t)}get pinSidebar(){return this._state.pinSidebar}set pinSidebar(e){let n=t(e,this.pinSidebar);this._state.setPinSidebar(!!n)}_applyLayout(){let e=r(this._state.sidebarPosition),t=this._state.sidebarPosition===`end`;if(!this._state.collapsed){this._detachScrim();let t=this._state.showSidebar;this._sidebar&&(this._sidebar.visibility=t?`visible`:`collapse`,this._sidebar.translateX=0,this._sidebar.opacity=1,a.setColumn(this._sidebar,e.sidebar),a.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth,this._sidebar.className=this._paneClassName(this._sidebar.className,!1),this._sidebar.horizontalAlignment=`stretch`),this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,t?e.content:0),a.setColumnSpan(this._content,t?1:2)),this._applyPaneFocus();return}this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2),this._scrim.visibility=this._state.shieldVisible?`visible`:`collapse`,this._scrim.opacity=+!!this._state.shieldVisible),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=t?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0),this._sidebar.visibility=this._state.showSidebar?`visible`:`collapse`,this._sidebar.translateX=this._state.showSidebar?0:this._hiddenOffset(),this._sidebar.opacity=1),this._applyPaneFocus()}_transitionSidebar(){if(!this._state.collapsed||!this._shouldAnimate()){this._applyLayout();return}this._cancelPending(),this._prepareCollapsedStructure(),this._applyPaneFocus(),this._state.showSidebar?this._animateOpen():this._animateClose()}_applyPaneFocus(){this._sidebar&&(this._sidebar.isUserInteractionEnabled=this._state.sidebarFocusable),this._content&&(this._content.isUserInteractionEnabled=this._state.contentFocusable)}_ensureScrim(){if(this._scrim)return this._scrim;let e=new a;return e.className=`adw-overlay-scrim`,e.visibility=`collapse`,e.opacity=0,e.addEventListener(`tap`,()=>this.hideSidebarPane()),this._scrim=e,e}_raiseOverlayChildren(){let e=this._ensureScrim();this._isChild(e)&&this.removeChild(e);let t=this._sidebar;t&&this._isChild(t)&&this.removeChild(t),this.addChild(e),t&&this.addChild(t)}_detachScrim(){this._scrim&&this._isChild(this._scrim)&&this.removeChild(this._scrim)}_prepareCollapsedStructure(){let e=this._state.sidebarPosition===`end`;this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2)),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=e?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0))}_animateOpen(){let e=this._scrim;e&&(e.visibility=`visible`,e.opacity=0,this._track(e.animate({opacity:1,duration:200,curve:`easeOut`})));let t=this._sidebar;t&&(t.visibility=`visible`,t.translateX=this._hiddenOffset(),t.opacity=1,this._track(t.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})))}_animateClose(){let e=this._scrim,t=this._sidebar,n=[];e&&n.push(this._track(e.animate({opacity:0,duration:200,curve:`easeIn`}))),t&&n.push(this._track(t.animate({translate:{x:this._hiddenOffset(),y:0},duration:200,curve:`easeIn`}))),Promise.all(n).then(()=>{this._state.showSidebar||(t&&(t.visibility=`collapse`),e&&(e.visibility=`collapse`))}).catch(()=>{})}_hiddenOffset(){let e=this.sidebarWidth;return this._state.sidebarPosition===`end`?e:-e}_paneClassName(e,t){return`${(e??``).split(/\s+/).filter(e=>e&&e!==`adw-overlay-active`&&e!==`adw-split-view-sidebar`).join(` `)} adw-split-view-sidebar${t?` adw-overlay-active`:``}`.trim()}};export{AdwOverlaySplitView};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{AdwImageButton as n}from"./adw-image-button.js";import{NS_PASSWORD_ENTRY_ROW_CLASS as r,applyPasswordEntryRowState as i}from"./entry-row-view.js";import{AdwEntryRow as a}from"./adw-entry-row.js";import{PasswordEntryRowState as o,PasswordEntryRowState as s}from"@gjsify/adwaita-core";import{dialogWarningSymbolic as c}from"@gjsify/adwaita-icons/status";const l=`notify::revealed`;var AdwPasswordEntryRow=class extends a{static GTypeName=`AdwPasswordEntryRow`;_password=new s(this._state);_peekButton;constructor(e){super(),this._field.className=`adw-entry-field adw-password-field`;let r=new n;r.className=`${r.className} adw-password-peek`.trim(),r.addEventListener(`tap`,()=>this._password.togglePeek()),this.add_suffix(r),this._peekButton=r,this.setIndicatorIcon(c),this._renderPassword(this._password.state),this._password.subscribe(e=>{this._renderPassword(e);let t={eventName:l,object:this,revealed:e.revealed};this.notify(t)}),t(this,e)}get revealed(){return this._password.revealed}set revealed(t){this._password.setRevealed(e(t,!1))}get peeking(){return this._password.revealed}set peeking(t){this._password.setRevealed(e(t,!1))}togglePeek(){return this._password.togglePeek()}get capsLockOn(){return this._password.capsLockOn}setCapsLockOn(e){this._password.setCapsLockOn(e)}get _baseClassName(){return r}_renderPassword(e){i({field:this._field,peekButton:this._peekButton},e)}};export{AdwPasswordEntryRow,l as NOTIFY_REVEALED,o as PasswordEntryRowState};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{AdwImageButton as n}from"./adw-image-button.js";import{NS_PASSWORD_ENTRY_ROW_CLASS as r,applyPasswordEntryRowState as i}from"./entry-row-view.js";import{AdwEntryRow as a}from"./adw-entry-row.js";import{PasswordEntryRowState as o,PasswordEntryRowState as s}from"@gjsify/adwaita-core";import{dialogWarningSymbolic as c}from"@gjsify/adwaita-icons/status";const l=`notify::revealed`;var AdwPasswordEntryRow=class extends a{static GTypeName=`AdwPasswordEntryRow`;_password=new s(this._state);_peekButton;constructor(t){super(),this._field.className=`adw-entry-field adw-password-field`;let r=new n;r.className=`${r.className} adw-password-peek`.trim(),r.addEventListener(`tap`,()=>this._password.togglePeek()),this.add_suffix(r),this._peekButton=r,this.setIndicatorIcon(c),this._renderPassword(this._password.state),this._password.subscribe(e=>{this._renderPassword(e);let t={eventName:l,object:this,revealed:e.revealed};this.notify(t)}),e(this,t)}get revealed(){return this._password.revealed}set revealed(e){this._password.setRevealed(t(e,!1))}get peeking(){return this._password.revealed}set peeking(e){this._password.setRevealed(t(e,!1))}togglePeek(){return this._password.togglePeek()}get capsLockOn(){return this._password.capsLockOn}setCapsLockOn(e){this._password.setCapsLockOn(e)}get _baseClassName(){return r}_renderPassword(e){i({field:this._field,peekButton:this._peekButton},e)}};export{AdwPasswordEntryRow,l as NOTIFY_REVEALED,o as PasswordEntryRowState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{AdwImageButton as r}from"./adw-image-button.js";import{searchNsPreferences as i}from"./preferences-search.js";import{GridLayout as a,ItemSpec as o,Label as s,StackLayout as c}from"@nativescript/core";import{windowCloseSymbolic as l}from"@gjsify/adwaita-icons/ui";const u=`closed`;var AdwPreferencesDialog=class extends n(a){static GTypeName=`AdwPreferencesDialog`;_card;_headerBox;_titleLabel;_body;constructor(e){super(),this.className=`adw-preferences-dialog`,this.visibility=`collapse`,this.addColumn(new o(1,`star`)),this.addRow(new o(1,`star`));let n=new a;n.className=`adw-preferences-dialog-card`,n.verticalAlignment=`middle`,n.horizontalAlignment=`center`,n.addColumn(new o(1,`star`)),n.addRow(new o(1,`auto`)),n.addRow(new o(1,`star`)),a.setColumn(n,0),a.setRow(n,0),this.addChild(n),this._card=n;let i=new a;i.className=`adw-preferences-dialog-header`,i.addColumn(new o(1,`star`)),i.addColumn(new o(1,`auto`)),i.addRow(new o(1,`auto`)),a.setRow(i,0),n.addChild(i),this._headerBox=i;let u=new s;u.className=`adw-preferences-dialog-title`,u.text=`Preferences`,a.setColumn(u,0),i.addChild(u),this._titleLabel=u;let d=new r;d.iconName=l,d.className=`${d.className} adw-preferences-dialog-close`.trim(),d.addEventListener(`tap`,()=>this.close()),a.setColumn(d,1),i.addChild(d);let f=new c;f.orientation=`vertical`,f.className=`adw-preferences-dialog-body`,a.setRow(f,1),n.addChild(f),this._body=f,t(this,e)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??`Preferences`}add(e){this._body.addChild(e)}_addChildFromBuilder(e,t){this.add(t)}remove(e){this._body.removeChild(e)}get searchPages(){let e=[],t=this._body.getChildrenCount();for(let n=0;n<t;n++){let t=this._body.getChildAt(n);typeof t.searchGroups==`function`&&e.push(t)}return e}search(e,t){return i(this.searchPages,e,t)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:u,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(t){e(t,!1)?this.present():this.close()}get body(){return this._body}};export{AdwPreferencesDialog,u as CLOSED};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{AdwImageButton as r}from"./adw-image-button.js";import{searchNsPreferences as i}from"./preferences-search.js";import{GridLayout as a,ItemSpec as o,Label as s,StackLayout as c}from"@nativescript/core";import{windowCloseSymbolic as l}from"@gjsify/adwaita-icons/ui";const u=`closed`;var AdwPreferencesDialog=class extends n(a){static GTypeName=`AdwPreferencesDialog`;_card;_headerBox;_titleLabel;_body;constructor(t){super(),this.className=`adw-preferences-dialog`,this.visibility=`collapse`,this.addColumn(new o(1,`star`)),this.addRow(new o(1,`star`));let n=new a;n.className=`adw-preferences-dialog-card`,n.verticalAlignment=`middle`,n.horizontalAlignment=`center`,n.addColumn(new o(1,`star`)),n.addRow(new o(1,`auto`)),n.addRow(new o(1,`star`)),a.setColumn(n,0),a.setRow(n,0),this.addChild(n),this._card=n;let i=new a;i.className=`adw-preferences-dialog-header`,i.addColumn(new o(1,`star`)),i.addColumn(new o(1,`auto`)),i.addRow(new o(1,`auto`)),a.setRow(i,0),n.addChild(i),this._headerBox=i;let u=new s;u.className=`adw-preferences-dialog-title`,u.text=`Preferences`,a.setColumn(u,0),i.addChild(u),this._titleLabel=u;let d=new r;d.iconName=l,d.className=`${d.className} adw-preferences-dialog-close`.trim(),d.addEventListener(`tap`,()=>this.close()),a.setColumn(d,1),i.addChild(d);let f=new c;f.orientation=`vertical`,f.className=`adw-preferences-dialog-body`,a.setRow(f,1),n.addChild(f),this._body=f,e(this,t)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??`Preferences`}add(e){this._body.addChild(e)}_addChildFromBuilder(e,t){this.add(t)}remove(e){this._body.removeChild(e)}get searchPages(){let e=[],t=this._body.getChildrenCount();for(let n=0;n<t;n++){let t=this._body.getChildAt(n);typeof t.searchGroups==`function`&&e.push(t)}return e}search(e,t){return i(this.searchPages,e,t)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:u,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(e){t(e,!1)?this.present():this.close()}get body(){return this._body}};export{AdwPreferencesDialog,u as CLOSED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{ScrollView as r,StackLayout as i}from"@nativescript/core";var AdwPreferencesPage=class extends n(r){static GTypeName=`AdwPreferencesPage`;_groups;_title=``;_name=``;_iconName=``;_useUnderline=!1;constructor(e){super(),this.orientation=`vertical`,this.className=`adw-preferences-page`;let n=new i;n.orientation=`vertical`,n.className=`adw-preferences-page-content`,this.content=n,this._groups=n,t(this,e)}get title(){return this._title}set title(e){this._title=e??``}get name(){return this._name}set name(e){this._name=e??``}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``}get useUnderline(){return this._useUnderline}set useUnderline(t){this._useUnderline=e(t,!1)}add(e){this._groups.addChild(e)}remove(e){this._groups.removeChild(e)}_addChildFromBuilder(e,t){this.add(t)}searchGroups(){let e=[],t=this._groups.getChildrenCount();for(let n=0;n<t;n++){let t=this._groups.getChildAt(n);typeof t.searchRows==`function`&&e.push(t)}return e}get groups(){return this._groups}};export{AdwPreferencesPage};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{ScrollView as r,StackLayout as i}from"@nativescript/core";var AdwPreferencesPage=class extends n(r){static GTypeName=`AdwPreferencesPage`;_groups;_title=``;_name=``;_iconName=``;_useUnderline=!1;constructor(t){super(),this.orientation=`vertical`,this.className=`adw-preferences-page`;let n=new i;n.orientation=`vertical`,n.className=`adw-preferences-page-content`,this.content=n,this._groups=n,e(this,t)}get title(){return this._title}set title(e){this._title=e??``}get name(){return this._name}set name(e){this._name=e??``}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=t(e,!1)}add(e){this._groups.addChild(e)}remove(e){this._groups.removeChild(e)}_addChildFromBuilder(e,t){this.add(t)}searchGroups(){let e=[],t=this._groups.getChildrenCount();for(let n=0;n<t;n++){let t=this._groups.getChildAt(n);typeof t.searchRows==`function`&&e.push(t)}return e}get groups(){return this._groups}};export{AdwPreferencesPage};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{attachRowPressFeedback as r}from"./row-press.js";import{AdwSidebarSection as i}from"../values/sidebar.js";import{SidebarState as a,sidebarRowClassName as o,sidebarSectionsFromLabels as s}from"./sidebar-model.js";import{GridLayout as c,ItemSpec as l,Label as u,ScrollView as d,StackLayout as f}from"@nativescript/core";const p=`notify::selected`,m=`activated`;var AdwSidebar=class extends n(d){static GTypeName=`AdwSidebar`;_list;_state=new a;_pendingSelected=null;_rows=[];constructor(e){super(),this.orientation=`vertical`,this.className=`adw-sidebar`;let n=new f;n.orientation=`vertical`,n.className=`adw-sidebar-list`,this.content=n,this._list=n,this._state.subscribe(e=>{this._applySelection();let t={eventName:p,object:this,selected:e.selected,title:e.item?.title??``,previous:e.previous,interactive:e.interactive};this.notify(t)}),t(this,e)}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.Sidebar takes only Adw.SidebarSection children, not \`${t.constructor.name}\`.`);this.setSections([...this._state.sections,t])}setItems(e){this.setSections(s(Array.isArray(e)?e:[]))}setSections(e){for(let t of e)t instanceof i&&t._bindOwner(()=>this.setSections(this._state.sections));if(this._state.setSections(e),this._pendingSelected!==null&&this._pendingSelected<this._state.items.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelected(e)}this._rebuild()}_rebuild(){for(let e of this._rows)this._list.removeChild(e.view);this._rows.length=0;for(let e of this._state.visibleItems){let t=new c;t.className=`adw-sidebar-row`,t.addColumn(new l(1,`star`)),t.addRow(new l(1,`auto`));let n=new u;n.className=`adw-sidebar-row-title`,n.text=e.item.title,n.textWrap=!0,c.setColumn(n,0),t.addChild(n),e.item.visible===!1&&(t.visibility=`collapse`),e.item.enabled===!1&&(t.opacity=.5),t.addEventListener(`tap`,()=>this._activate(e.index)),r(t),this._list.addChild(t),this._rows.push({view:t,index:e.index})}this._applySelection()}_activate(e){if(!this._state.activate(e).activated)return;let t={eventName:m,object:this,index:e,title:this._state.itemAt(e)?.title??``};this.notify(t)}_applySelection(){let e=this._state.selected,t=this._state.selectionVisible;for(let n of this._rows)n.view.className=o(n.index===e,t)}get items(){return this._state.items.map(e=>e.item.title)}set items(e){this.setItems(e)}get sections(){return this._state.sections}set sections(e){this.setSections(e)}get selected(){return this._state.selected}set selected(t){let n=e(t,this.selected);if(this._state.items.length===0){this._pendingSelected=n;return}this._state.setSelected(n)}get selectedItem(){return this._state.selectedItem}get mode(){return this._state.mode}set mode(e){this._state.setMode(e)&&this._applySelection()}get filter(){return this._state.filter}set filter(e){this._state.setFilter(e),this._rebuild()}get isEmpty(){return this._state.isEmpty}};export{m as ACTIVATED,AdwSidebar,p as NOTIFY_SELECTED};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{attachRowPressFeedback as r}from"./row-press.js";import{AdwSidebarSection as i}from"../values/sidebar.js";import{SidebarState as a,sidebarRowClassName as o,sidebarSectionsFromLabels as s}from"./sidebar-model.js";import{GridLayout as c,ItemSpec as l,Label as u,ScrollView as d,StackLayout as f}from"@nativescript/core";const p=`notify::selected`,m=`activated`;var AdwSidebar=class extends n(d){static GTypeName=`AdwSidebar`;_list;_state=new a;_pendingSelected=null;_rows=[];constructor(t){super(),this.orientation=`vertical`,this.className=`adw-sidebar`;let n=new f;n.orientation=`vertical`,n.className=`adw-sidebar-list`,this.content=n,this._list=n,this._state.subscribe(e=>{this._applySelection();let t={eventName:p,object:this,selected:e.selected,title:e.item?.title??``,previous:e.previous,interactive:e.interactive};this.notify(t)}),e(this,t)}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.Sidebar takes only Adw.SidebarSection children, not \`${t.constructor.name}\`.`);this.setSections([...this._state.sections,t])}setItems(e){this.setSections(s(Array.isArray(e)?e:[]))}setSections(e){for(let t of e)t instanceof i&&t._bindOwner(()=>this.setSections(this._state.sections));if(this._state.setSections(e),this._pendingSelected!==null&&this._pendingSelected<this._state.items.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelected(e)}this._rebuild()}_rebuild(){for(let e of this._rows)this._list.removeChild(e.view);this._rows.length=0;for(let e of this._state.visibleItems){let t=new c;t.className=`adw-sidebar-row`,t.addColumn(new l(1,`star`)),t.addRow(new l(1,`auto`));let n=new u;n.className=`adw-sidebar-row-title`,n.text=e.item.title,n.textWrap=!0,c.setColumn(n,0),t.addChild(n),e.item.visible===!1&&(t.visibility=`collapse`),e.item.enabled===!1&&(t.opacity=.5),t.addEventListener(`tap`,()=>this._activate(e.index)),r(t),this._list.addChild(t),this._rows.push({view:t,index:e.index})}this._applySelection()}_activate(e){if(!this._state.activate(e).activated)return;let t={eventName:m,object:this,index:e,title:this._state.itemAt(e)?.title??``};this.notify(t)}_applySelection(){let e=this._state.selected,t=this._state.selectionVisible;for(let n of this._rows)n.view.className=o(n.index===e,t)}get items(){return this._state.items.map(e=>e.item.title)}set items(e){this.setItems(e)}get sections(){return this._state.sections}set sections(e){this.setSections(e)}get selected(){return this._state.selected}set selected(e){let n=t(e,this.selected);if(this._state.items.length===0){this._pendingSelected=n;return}this._state.setSelected(n)}get selectedItem(){return this._state.selectedItem}get mode(){return this._state.mode}set mode(e){this._state.setMode(e)&&this._applySelection()}get filter(){return this._state.filter}set filter(e){this._state.setFilter(e),this._rebuild()}get isEmpty(){return this._state.isEmpty}};export{m as ACTIVATED,AdwSidebar,p as NOTIFY_SELECTED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{SpinState as r,parseAdjustment as i,snapAdjustmentValue as a}from"@gjsify/adwaita-core";import{GridLayout as o,ItemSpec as s,Label as c,Slider as l,StackLayout as u}from"@nativescript/core";const d=`notify::value`;var AdwSliderRow=class extends n(u){static GTypeName=`AdwSliderRow`;_titleLabel;_valueLabel;_slider;_state=new r;_suppress=!1;constructor(e){super(),this.orientation=`vertical`,this.className=`adw-slider-row`;let n=new o;n.className=`adw-slider-header`,n.addRow(new s(1,`auto`)),n.addColumn(new s(1,`star`)),n.addColumn(new s(1,`auto`));let r=new c;r.className=`adw-slider-title`,r.textWrap=!1,o.setColumn(r,0),n.addChild(r);let i=new c;i.className=`adw-slider-value`,i.text=String(this._state.value),o.setColumn(i,1),n.addChild(i);let u=this._state.adjustment,f=new l;f.className=`adw-slider`,f.minValue=u.lower,f.maxValue=u.upper,f.value=u.value,this.addChild(n),this.addChild(f),this._titleLabel=r,this._valueLabel=i,this._slider=f,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:d,object:this,value:e.value};this.notify(t)}else this._sync()}),this._state.subscribeChanged(e=>{this._slider.minValue=e.lower,this._slider.maxValue=e.upper;let t=a(e,this._state.value);t===this._state.value?this._sync():this._state.setValue(t)}),f.addEventListener(`valueChange`,()=>{if(this._suppress)return;let e=a(this._state.adjustment,this._slider.value);e!==this._slider.value&&(this._suppress=!0,this._slider.value=e,this._suppress=!1),this._state.setValueInteractive(e)}),t(this,e)}_sync(){this._suppress=!0,this._slider.value=this._state.value,this._suppress=!1,this._valueLabel.text=String(this._state.value)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get value(){return this._state.value}set value(t){this._state.setValue(a(this._state.adjustment,e(t,this.value)))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?i(e):e)}get slider(){return this._slider}};export{AdwSliderRow,d as NOTIFY_SLIDER_VALUE};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{SpinState as r,parseAdjustment as i,snapAdjustmentValue as a}from"@gjsify/adwaita-core";import{GridLayout as o,ItemSpec as s,Label as c,Slider as l,StackLayout as u}from"@nativescript/core";const d=`notify::value`;var AdwSliderRow=class extends n(u){static GTypeName=`AdwSliderRow`;_titleLabel;_valueLabel;_slider;_state=new r;_suppress=!1;constructor(t){super(),this.orientation=`vertical`,this.className=`adw-slider-row`;let n=new o;n.className=`adw-slider-header`,n.addRow(new s(1,`auto`)),n.addColumn(new s(1,`star`)),n.addColumn(new s(1,`auto`));let r=new c;r.className=`adw-slider-title`,r.textWrap=!1,o.setColumn(r,0),n.addChild(r);let i=new c;i.className=`adw-slider-value`,i.text=String(this._state.value),o.setColumn(i,1),n.addChild(i);let u=this._state.adjustment,f=new l;f.className=`adw-slider`,f.minValue=u.lower,f.maxValue=u.upper,f.value=u.value,this.addChild(n),this.addChild(f),this._titleLabel=r,this._valueLabel=i,this._slider=f,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:d,object:this,value:e.value};this.notify(t)}else this._sync()}),this._state.subscribeChanged(e=>{this._slider.minValue=e.lower,this._slider.maxValue=e.upper;let t=a(e,this._state.value);t===this._state.value?this._sync():this._state.setValue(t)}),f.addEventListener(`valueChange`,()=>{if(this._suppress)return;let e=a(this._state.adjustment,this._slider.value);e!==this._slider.value&&(this._suppress=!0,this._slider.value=e,this._suppress=!1),this._state.setValueInteractive(e)}),e(this,t)}_sync(){this._suppress=!0,this._slider.value=this._state.value,this._suppress=!1,this._valueLabel.text=String(this._state.value)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get value(){return this._state.value}set value(e){this._state.setValue(a(this._state.adjustment,t(e,this.value)))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?i(e):e)}get slider(){return this._slider}};export{AdwSliderRow,d as NOTIFY_SLIDER_VALUE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{AdwImageButton as a}from"./adw-image-button.js";import{SpinState as o,SpinState as s,parseAdjustment as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";import{valueDecreaseSymbolic as d,valueIncreaseSymbolic as f}from"@gjsify/adwaita-icons/actions";const p=`notify::value`;var AdwSpinRow=class extends i{static GTypeName=`AdwSpinRow`;static builderSlots=e([...i.builderSlots,`adjustment`],`suffix`);_minusButton;_plusButton;_valueLabel;_state=new s;constructor(e){super(),this.className=`adw-row adw-action-row adw-spin-row`;let t=new u;t.orientation=`horizontal`,t.className=`adw-spin-control`;let n=new l;n.className=`adw-spin-value`,n.text=String(this._state.value);let i=new a;i.iconName=d,i.className=`${i.className} adw-spin-button adw-spin-minus`.trim();let o=new a;o.iconName=f,o.className=`${o.className} adw-spin-button adw-spin-plus`.trim(),t.addChild(n),t.addChild(i),t.addChild(o),this.add_suffix(t),this._minusButton=i,this._plusButton=o,this._valueLabel=n,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:p,object:this,value:e.value};this.notify(t)}}),i.addEventListener(`tap`,()=>this._state.decrement()),o.addEventListener(`tap`,()=>this._state.increment()),r(this,e)}_addChildFromBuilder(e,n){if(t(e,[`adjustment`],`edge`)===`adjustment`){this.adjustment=n;return}super._addChildFromBuilder(e,n)}get value(){return this._state.value}set value(e){this._state.setValue(n(e,this._state.value))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?c(e):e)}};export{AdwSpinRow,p as NOTIFY_VALUE,o as SpinState};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlNumber as r}from"./xml-values.js";import{AdwActionRow as i}from"./adw-action-row.js";import{AdwImageButton as a}from"./adw-image-button.js";import{SpinState as o,SpinState as s,parseAdjustment as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";import{valueDecreaseSymbolic as d,valueIncreaseSymbolic as f}from"@gjsify/adwaita-icons/actions";const p=`notify::value`;var AdwSpinRow=class extends i{static GTypeName=`AdwSpinRow`;static builderSlots=e([...i.builderSlots,`adjustment`],`suffix`);_minusButton;_plusButton;_valueLabel;_state=new s;constructor(e){super(),this.className=`adw-row adw-action-row adw-spin-row`;let t=new u;t.orientation=`horizontal`,t.className=`adw-spin-control`;let r=new l;r.className=`adw-spin-value`,r.text=String(this._state.value);let i=new a;i.iconName=d,i.className=`${i.className} adw-spin-button adw-spin-minus`.trim();let o=new a;o.iconName=f,o.className=`${o.className} adw-spin-button adw-spin-plus`.trim(),t.addChild(r),t.addChild(i),t.addChild(o),this.add_suffix(t),this._minusButton=i,this._plusButton=o,this._valueLabel=r,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:p,object:this,value:e.value};this.notify(t)}}),i.addEventListener(`tap`,()=>this._state.decrement()),o.addEventListener(`tap`,()=>this._state.increment()),n(this,e)}_addChildFromBuilder(e,n){if(t(e,[`adjustment`],`edge`)===`adjustment`){this.adjustment=n;return}super._addChildFromBuilder(e,n)}get value(){return this._state.value}set value(e){this._state.setValue(r(e,this._state.value))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?c(e):e)}};export{AdwSpinRow,p as NOTIFY_VALUE,o as SpinState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{DEFAULT_SPINNER_SIZE as r}from"./chrome.js";import{resolveSpinnerSize as i,spinnerGeometry as a}from"@gjsify/adwaita-core";import{ActivityIndicator as o,GridLayout as s,ItemSpec as c}from"@nativescript/core";var AdwSpinner=class extends n(s){static GTypeName=`AdwSpinner`;_indicator;_size=r;_spinning=!0;constructor(e){super(),this.className=`adw-spinner`,this.addRow(new c(1,`star`)),this.addColumn(new c(1,`star`));let n=new o;n.className=`adw-spinner-ring`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,this._indicator=n,this.addChild(n),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning(),t(this,e)}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=a(this._size,this._size);this._indicator.width=e,this._indicator.height=e}_applySpinning(){let e=this.isLoaded!==!1;this._indicator.busy=this._spinning&&e}get spinning(){return this._spinning}set spinning(t){this._spinning=e(t,!1),this._applySpinning()}get size(){return this._size}set size(e){this._size=i(e),this._applySize()}get ringDiameter(){return a(this._size,this._size).diameter}};export{AdwSpinner,r as DEFAULT_SPINNER_SIZE};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{DEFAULT_SPINNER_SIZE as r}from"./chrome.js";import{resolveSpinnerSize as i,spinnerGeometry as a}from"@gjsify/adwaita-core";import{ActivityIndicator as o,GridLayout as s,ItemSpec as c}from"@nativescript/core";var AdwSpinner=class extends n(s){static GTypeName=`AdwSpinner`;_indicator;_size=r;_spinning=!0;constructor(t){super(),this.className=`adw-spinner`,this.addRow(new c(1,`star`)),this.addColumn(new c(1,`star`));let n=new o;n.className=`adw-spinner-ring`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,this._indicator=n,this.addChild(n),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning(),e(this,t)}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=a(this._size,this._size);this._indicator.width=e,this._indicator.height=e}_applySpinning(){let e=this.isLoaded!==!1;this._indicator.busy=this._spinning&&e}get spinning(){return this._spinning}set spinning(e){this._spinning=t(e,!1),this._applySpinning()}get size(){return this._size}set size(e){this._size=i(e),this._applySize()}get ringDiameter(){return a(this._size,this._size).diameter}};export{AdwSpinner,r as DEFAULT_SPINNER_SIZE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{assertPopupMenuAssignable as a,refuseMenuString as o}from"./popup-menu.js";import{showMenuPopup as s}from"./popup-menu-view.js";import{setActionIcon as c,splitButtonArrowSvg as l}from"./split-button.js";import{ArrowType as u}from"./gtk-enums.js";import{SPLIT_BUTTON_DISABLED_OPACITY as d,SplitButtonState as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m,Label as h,StackLayout as g}from"@nativescript/core";const _=`clicked`,v=`notify::direction`,y=`menuTapped`;var AdwSplitButton=class extends n(p){static GTypeName=`AdwSplitButton`;static emittedSignals=[v];_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new f;_actions=null;_showingIcon=!1;_sensitive=!0;constructor(e){super(),this.className=`adw-split-button`,this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,`auto`)),this.addRow(new m(1,`auto`));let n=new g;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,p.setColumn(n,0);let a=new h;a.className=`adw-split-button-label`,a.verticalAlignment=`middle`,n.addChild(a);let o=new r;o.className=`${o.className} adw-split-button-action-icon`.trim(),o.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=a,this._actionIcon=o;let s=new p;s.className=`adw-split-button-dropdown`,s.addColumn(new m(1,`star`)),s.addRow(new m(1,`star`)),p.setColumn(s,1);let c=new r;c.className=`${c.className} adw-split-button-chevron`.trim(),c.iconName=l(this._state.direction),c.horizontalAlignment=`center`,c.verticalAlignment=`middle`,s.addChild(c),this.addChild(s),this._dropdownPart=s,this._chevron=c,n.addEventListener(`tap`,()=>{if(!this._sensitive)return;let e={eventName:_,object:this};this.notify(e)}),s.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(s),this._state.subscribe(()=>this._render()),this._render(),t(this,e)}_openMenu(){if(!(!this._sensitive||this._state.open||!this._state.dropdownEnabled)){this._state.toggleMenu();try{s(this._dropdownPart,{model:this._state.menuModel??[],actions:this._actions,onActivated:(e,t)=>{let n=this._state.activateMenuItem(t);if(n===null)return;let r={eventName:y,object:this,item:n.label,id:n.id??n.label,path:t,action:n.action};this.notify(r)},onDismiss:()=>this._state.closeMenu()})}catch(e){throw this._state.closeMenu(),e}}}_render(){let{mode:e,label:t,iconName:n,direction:r,dropdownEnabled:i}=this._state,a=e===`icon`;a?this._actionIcon.iconName=n??``:this._actionLabel.text=t??``,a!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(a?this._actionIcon:this._actionLabel),this._showingIcon=a),this._chevron.iconName=l(r),this._dropdownPart.opacity=i?1:d,this.opacity=this._sensitive?1:d}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get iconName(){return this._state.iconName??``}set iconName(e){c(this._state,e)}get menuModel(){return this._state.menuModel??[]}set menuModel(e){o(e,`AdwSplitButton`),this._state.setMenuModel(e),a(this._state.menuModel??[])}get actions(){return this._actions}set actions(e){this._actions=e??null}get_direction(){return u[this._state.direction.toUpperCase()]}set_direction(e){let t=e,n=typeof t==`number`?t:/^\d+$/.test(String(t))?Number(t):u[String(t).toUpperCase()],r=Object.keys(u).find(e=>u[e]===n)?.toLowerCase();if(r===void 0)throw TypeError(`${String(t)} is not a valid value for enum argument direction (Gtk.ArrowType)`);this._state.setDirection(r)&&this.notify({eventName:v,object:this,value:this.get_direction()})}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._state.setUseUnderline(!!n)}get sensitive(){return this._sensitive}set sensitive(t){let n=!!e(t,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,_ as CLICKED,y as MENU_TAPPED,v as NOTIFY_DIRECTION};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{assertPopupMenuAssignable as a,refuseMenuString as o}from"./popup-menu.js";import{showMenuPopup as s}from"./popup-menu-view.js";import{setActionIcon as c,splitButtonArrowSvg as l}from"./split-button.js";import{ArrowType as u}from"./gtk-enums.js";import{SPLIT_BUTTON_DISABLED_OPACITY as d,SplitButtonState as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m,Label as h,StackLayout as g}from"@nativescript/core";const _=`clicked`,v=`notify::direction`,y=`menuTapped`;var AdwSplitButton=class extends n(p){static GTypeName=`AdwSplitButton`;static emittedSignals=[v];_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new f;_actions=null;_showingIcon=!1;_sensitive=!0;constructor(t){super(),this.className=`adw-split-button`,this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,`auto`)),this.addRow(new m(1,`auto`));let n=new g;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,p.setColumn(n,0);let a=new h;a.className=`adw-split-button-label`,a.verticalAlignment=`middle`,n.addChild(a);let o=new r;o.className=`${o.className} adw-split-button-action-icon`.trim(),o.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=a,this._actionIcon=o;let s=new p;s.className=`adw-split-button-dropdown`,s.addColumn(new m(1,`star`)),s.addRow(new m(1,`star`)),p.setColumn(s,1);let c=new r;c.className=`${c.className} adw-split-button-chevron`.trim(),c.iconName=l(this._state.direction),c.horizontalAlignment=`center`,c.verticalAlignment=`middle`,s.addChild(c),this.addChild(s),this._dropdownPart=s,this._chevron=c,n.addEventListener(`tap`,()=>{if(!this._sensitive)return;let e={eventName:_,object:this};this.notify(e)}),s.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(s),this._state.subscribe(()=>this._render()),this._render(),e(this,t)}_openMenu(){if(!(!this._sensitive||this._state.open||!this._state.dropdownEnabled)){this._state.toggleMenu();try{s(this._dropdownPart,{model:this._state.menuModel??[],actions:this._actions,onActivated:(e,t)=>{let n=this._state.activateMenuItem(t);if(n===null)return;let r={eventName:y,object:this,item:n.label,id:n.id??n.label,path:t,action:n.action};this.notify(r)},onDismiss:()=>this._state.closeMenu()})}catch(e){throw this._state.closeMenu(),e}}}_render(){let{mode:e,label:t,iconName:n,direction:r,dropdownEnabled:i}=this._state,a=e===`icon`;a?this._actionIcon.iconName=n??``:this._actionLabel.text=t??``,a!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(a?this._actionIcon:this._actionLabel),this._showingIcon=a),this._chevron.iconName=l(r),this._dropdownPart.opacity=i?1:d,this.opacity=this._sensitive?1:d}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get iconName(){return this._state.iconName??``}set iconName(e){c(this._state,e)}get menuModel(){return this._state.menuModel??[]}set menuModel(e){o(e,`AdwSplitButton`),this._state.setMenuModel(e),a(this._state.menuModel??[])}get actions(){return this._actions}set actions(e){this._actions=e??null}get_direction(){return u[this._state.direction.toUpperCase()]}set_direction(e){let t=e,n=typeof t==`number`?t:/^\d+$/.test(String(t))?Number(t):u[String(t).toUpperCase()],r=Object.keys(u).find(e=>u[e]===n)?.toLowerCase();if(r===void 0)throw TypeError(`${String(t)} is not a valid value for enum argument direction (Gtk.ArrowType)`);this._state.setDirection(r)&&this.notify({eventName:v,object:this,value:this.get_direction()})}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(e){let n=t(e,this.useUnderline);this._state.setUseUnderline(!!n)}get sensitive(){return this._sensitive}set sensitive(e){let n=!!t(e,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,_ as CLICKED,y as MENU_TAPPED,v as NOTIFY_DIRECTION};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{SwitchRowState as n,switchClassName as r}from"./row-state.js";import{AdwActionRow as i}from"./adw-action-row.js";import{Switch as a}from"@nativescript/core";const o=`notify::active`;var AdwSwitchRow=class extends i{static GTypeName=`AdwSwitchRow`;static emittedSignals=[o];_switch;_switchState=new n;constructor(e){super(),this.className=`adw-row adw-action-row adw-switch-row`;let n=new a;n.className=r(!1),this.add_suffix(n),this._switch=n,this.activatableWidget=n,this.activatable=!0,n.addEventListener(`checkedChange`,()=>{n.className=r(n.checked),this._apply(this._switchState.setActive(n.checked))}),t(this,e)}get active(){return this._switchState.active}set active(t){this._apply(this._switchState.setActive(e(t,!1)))}activate(){this.activatable&&(this._apply(this._switchState.activate()),super.activate())}_apply(e){if(!e)return;this._switch.checked=this._switchState.active;let t={eventName:o,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,o as NOTIFY_ACTIVE};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{SwitchRowState as n,switchClassName as r}from"./row-state.js";import{AdwActionRow as i}from"./adw-action-row.js";import{Switch as a}from"@nativescript/core";const o=`notify::active`;var AdwSwitchRow=class extends i{static GTypeName=`AdwSwitchRow`;static emittedSignals=[o];_switch;_switchState=new n;constructor(t){super(),this.className=`adw-row adw-action-row adw-switch-row`;let n=new a;n.className=r(!1),this.add_suffix(n),this._switch=n,this.activatableWidget=n,this.activatable=!0,n.addEventListener(`checkedChange`,()=>{n.className=r(n.checked),this._apply(this._switchState.setActive(n.checked))}),e(this,t)}get active(){return this._switchState.active}set active(e){this._apply(this._switchState.setActive(t(e,!1)))}get_active(){return this.active}set_active(e){this.active=e}activate(){this.activatable&&(this._apply(this._switchState.activate()),super.activate())}_apply(e){if(!e)return;this._switch.checked=this._switchState.active;let t={eventName:o,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,o as NOTIFY_ACTIVE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{AdwImageButton as a}from"./adw-image-button.js";import{AdwTabPage as o}from"../values/tab-page.js";import{applyTabViewVisibility as s,createTabViewState as c,tabBarVisibility as l,tabCloseVisibilities as u,tabLabelText as d,tabViewNotifyPayload as f}from"./tab-view-state.js";import{tabIconState as p}from"@gjsify/adwaita-core";import{GridLayout as m,ItemSpec as h,Label as g,StackLayout as _}from"@nativescript/core";import{windowCloseSymbolic as v}from"@gjsify/adwaita-icons/ui";const pageHandle=e=>typeof e==`string`?e:e.id,y=`notify::selected-page`,b=`pages-changed`,x=`close-page`;var AdwTabView=class extends n(m){static GTypeName=`AdwTabView`;_state=c({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(e){super(),this.className=`adw-tab-view`,this.addColumn(new h(1,`star`)),this.addRow(new h(1,`auto`)),this.addRow(new h(1,`star`));let n=new _;n.orientation=`horizontal`,n.horizontalAlignment=`stretch`,n.className=`adw-tab-view-bar`,m.setRow(n,0),this.addChild(n),this._bar=n;let r=new m;r.addColumn(new h(1,`star`)),r.addRow(new h(1,`star`)),m.setRow(r,1),this.addChild(r),this._contentArea=r,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:y,object:this,...f(e)};this.notify(t)}),t(this,e)}get pages(){return this._state.pages}get nPages(){return this._state.nPages}get nPinnedPages(){return this._state.nPinnedPages}get selectedId(){return this._state.selectedId}get selectedIndex(){return this._state.selectedIndex}get selectedPage(){return this._state.selectedPage}set selectedPage(e){this._state.setSelectedPage(e)}isClosing(e){return this._state.isClosing(e)}set_selected_page(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}select_previous_page(){return this._state.selectPreviousPage()}select_next_page(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}add_page(e,t=null){return this._state.addPage(e,t===null?null:pageHandle(t))}insert(e,t){return this._state.insertPage(e,t)}prepend(e){return this._state.prependPage(e)}append(e){return this._state.appendPage(e)}insert_pinned(e,t){return this._state.insertPinnedPage(e,t)}prepend_pinned(e){return this._state.prependPinnedPage(e)}append_pinned(e){return this._state.appendPinnedPage(e)}set_page_pinned(e,t){return this._state.setPagePinned(pageHandle(e),t)}close_page(e){return this._state.closePage(pageHandle(e))}close_page_finish(e,t){return this._state.closePageFinish(pageHandle(e),t)}close_other_pages(e){this._state.closeOtherPages(pageHandle(e))}close_pages_before(e){this._state.closePagesBefore(pageHandle(e))}close_pages_after(e){this._state.closePagesAfter(pageHandle(e))}detachPage(e){return this._state.detachPage(e)}reorder_page(e,t){return this._state.reorderPage(pageHandle(e),t)}reorder_backward(e){return this._state.reorderBackward(pageHandle(e))}reorder_forward(e){return this._state.reorderForward(pageHandle(e))}reorder_first(e){return this._state.reorderFirst(pageHandle(e))}reorder_last(e){return this._state.reorderLast(pageHandle(e))}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(t){let n=e(t,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}_addChildFromBuilder(e,t){if(t instanceof o){if(t.child===null)throw Error(`Adw.TabPage has no child: a tab page is a page around one.`);this._state.appendPage({id:this._nextId(),title:t.title,content:t.child});return}this._state.appendPage({id:this._nextId(),content:t})}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:b,object:this,...e};this.notify(t)}_insertChip(e,t){let n=new _;n.orientation=`horizontal`,n.className=`adw-tab-view-tab`,n.verticalAlignment=`middle`;let o=new r;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,n.addChild(s);let c=new g;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,n.addChild(c);let l=new a;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=v,l.pixelSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),n.addChild(l),i(n),n.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(n,t),this._chips.set(e.id,{button:n,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(m.setColumn(u,0),m.setRow(u,0),this._contentArea.addChild(u)),this._refreshChip(e.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=d(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=p(t,this._defaultIcon);n.icon.iconName=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.iconName=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){s(this._state);let e=u(this._state),t=this._state.selectedId;this._state.pages.forEach((n,r)=>{let i=this._chips.get(n.id);i&&(i.button.className=n.id===t?`adw-tab-view-tab active`:`adw-tab-view-tab`,i.close.visibility=e[r])})}_applyBarVisibility(){this._bar.visibility=l(this._state,this._autohide)}_requestClose(e){let t={eventName:x,object:this,id:e.id,index:this._state.getPagePosition(e.id)};return this.notify(t),this.closeHandler?this.closeHandler(e):!e.pinned}_nextId(){return this._generatedIds+=1,`tab-${this._generatedIds}`}};export{AdwTabView,x as CLOSE_PAGE,y as NOTIFY_SELECTED_PAGE,b as PAGES_CHANGED};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{AdwImageButton as a}from"./adw-image-button.js";import{AdwTabPage as o}from"../values/tab-page.js";import{applyTabViewVisibility as s,createTabViewState as c,tabBarVisibility as l,tabCloseVisibilities as u,tabLabelText as d,tabViewNotifyPayload as f}from"./tab-view-state.js";import{tabIconState as p}from"@gjsify/adwaita-core";import{GridLayout as m,ItemSpec as h,Label as g,StackLayout as _}from"@nativescript/core";import{windowCloseSymbolic as v}from"@gjsify/adwaita-icons/ui";const pageHandle=e=>typeof e==`string`?e:e.id,y=`notify::selected-page`,b=`pages-changed`,x=`close-page`;var AdwTabView=class extends n(m){static GTypeName=`AdwTabView`;_state=c({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(t){super(),this.className=`adw-tab-view`,this.addColumn(new h(1,`star`)),this.addRow(new h(1,`auto`)),this.addRow(new h(1,`star`));let n=new _;n.orientation=`horizontal`,n.horizontalAlignment=`stretch`,n.className=`adw-tab-view-bar`,m.setRow(n,0),this.addChild(n),this._bar=n;let r=new m;r.addColumn(new h(1,`star`)),r.addRow(new h(1,`star`)),m.setRow(r,1),this.addChild(r),this._contentArea=r,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:y,object:this,...f(e)};this.notify(t)}),e(this,t)}get pages(){return this._state.pages}get nPages(){return this._state.nPages}get nPinnedPages(){return this._state.nPinnedPages}get selectedId(){return this._state.selectedId}get selectedIndex(){return this._state.selectedIndex}get selectedPage(){return this._state.selectedPage}set selectedPage(e){this._state.setSelectedPage(e)}isClosing(e){return this._state.isClosing(e)}set_selected_page(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}select_previous_page(){return this._state.selectPreviousPage()}select_next_page(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}add_page(e,t=null){return this._state.addPage(e,t===null?null:pageHandle(t))}insert(e,t){return this._state.insertPage(e,t)}prepend(e){return this._state.prependPage(e)}append(e){return this._state.appendPage(e)}insert_pinned(e,t){return this._state.insertPinnedPage(e,t)}prepend_pinned(e){return this._state.prependPinnedPage(e)}append_pinned(e){return this._state.appendPinnedPage(e)}set_page_pinned(e,t){return this._state.setPagePinned(pageHandle(e),t)}close_page(e){return this._state.closePage(pageHandle(e))}close_page_finish(e,t){return this._state.closePageFinish(pageHandle(e),t)}close_other_pages(e){this._state.closeOtherPages(pageHandle(e))}close_pages_before(e){this._state.closePagesBefore(pageHandle(e))}close_pages_after(e){this._state.closePagesAfter(pageHandle(e))}detachPage(e){return this._state.detachPage(e)}reorder_page(e,t){return this._state.reorderPage(pageHandle(e),t)}reorder_backward(e){return this._state.reorderBackward(pageHandle(e))}reorder_forward(e){return this._state.reorderForward(pageHandle(e))}reorder_first(e){return this._state.reorderFirst(pageHandle(e))}reorder_last(e){return this._state.reorderLast(pageHandle(e))}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(e){let n=t(e,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}_addChildFromBuilder(e,t){if(t instanceof o){if(t.child===null)throw Error(`Adw.TabPage has no child: a tab page is a page around one.`);this._state.appendPage({id:this._nextId(),title:t.title,content:t.child});return}this._state.appendPage({id:this._nextId(),content:t})}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:b,object:this,...e};this.notify(t)}_insertChip(e,t){let n=new _;n.orientation=`horizontal`,n.className=`adw-tab-view-tab`,n.verticalAlignment=`middle`;let o=new r;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,n.addChild(s);let c=new g;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,n.addChild(c);let l=new a;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=v,l.pixelSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),n.addChild(l),i(n),n.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(n,t),this._chips.set(e.id,{button:n,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(m.setColumn(u,0),m.setRow(u,0),this._contentArea.addChild(u)),this._refreshChip(e.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=d(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=p(t,this._defaultIcon);n.icon.iconName=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.iconName=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){s(this._state);let e=u(this._state),t=this._state.selectedId;this._state.pages.forEach((n,r)=>{let i=this._chips.get(n.id);i&&(i.button.className=n.id===t?`adw-tab-view-tab active`:`adw-tab-view-tab`,i.close.visibility=e[r])})}_applyBarVisibility(){this._bar.visibility=l(this._state,this._autohide)}_requestClose(e){let t={eventName:x,object:this,id:e.id,index:this._state.getPagePosition(e.id)};return this.notify(t),this.closeHandler?this.closeHandler(e):!e.pinned}_nextId(){return this._generatedIds+=1,`tab-${this._generatedIds}`}};export{AdwTabView,x as CLOSE_PAGE,y as NOTIFY_SELECTED_PAGE,b as PAGES_CHANGED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{AdwToggle as i}from"./adw-toggle.js";import{ToggleGroupState as a,ToggleGroupState as o,keptToggles as s,toggleIndexOfName as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";const d=`notify::selected`;var AdwToggleGroup=class extends n(u){static GTypeName=`AdwToggleGroup`;_toggles=[];_pendingActive=null;_pendingActiveName=null;_segments=[];_state=new o;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:d,object:this,selected:e.selected,value:e.value};this.notify(t)}),t(this,e)}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){this._rebuild(e),this._applyPending(!1)}_rebuild(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=s(Array.isArray(e)?e:[]),this._toggles.forEach((e,t)=>{let n=new u;if(n.orientation=`horizontal`,n.className=`adw-toggle-button`,n.horizontalAlignment=`center`,e.icon){let t=new r;t.className=`${t.className} adw-toggle-icon`.trim(),t.verticalAlignment=`middle`,t.iconName=e.icon,n.addChild(t)}let i=new l;i.text=e.label,i.className=`adw-toggle-label`,i.verticalAlignment=`middle`,n.addChild(i),n.addEventListener(`tap`,()=>{this._state.setSelected(t)}),this.addChild(n),this._segments.push(n)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.ToggleGroup takes only Adw.Toggle children, not \`${t.constructor.name}\`.`);let n=this._toggles.length;this._rebuild([...this._toggles,{label:t.label,icon:t.iconName??void 0,name:t.name===``?null:t.name}]),this._toggles.length===n&&console.warn(`[AdwToggleGroup] a toggle named '${t.name}' already exists; this one is not added`),this._applyPending(!0)}_applyPending(e){if(this._pendingActive!==null&&this._pendingActive<this._toggles.length){let e=this._pendingActive;this._pendingActive=null,this._state.setSelected(e)}if(this._pendingActiveName!==null){let t=c(this._toggles.map(e=>e.name),this._pendingActiveName);e||(this._pendingActiveName=null),t!==-1&&this._state.setSelected(t)}}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(t){let n=e(t,this.active);if(n>=this._toggles.length){this._pendingActive=n;return}this._state.setSelected(n)}get activeName(){return this._toggles[this.active]?.name??null}set activeName(e){this._pendingActiveName=e,this._applyPending(!0)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,d as NOTIFY_SELECTED,a as ToggleGroupState};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{AdwToggle as i}from"./adw-toggle.js";import{ToggleGroupState as a,ToggleGroupState as o,keptToggles as s,toggleIndexOfName as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";const d=`notify::selected`;var AdwToggleGroup=class extends n(u){static GTypeName=`AdwToggleGroup`;_toggles=[];_pendingActive=null;_pendingActiveName=null;_segments=[];_state=new o;constructor(t){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:d,object:this,selected:e.selected,value:e.value};this.notify(t)}),e(this,t)}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){this._rebuild(e),this._applyPending(!1)}_rebuild(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=s(Array.isArray(e)?e:[]),this._toggles.forEach((e,t)=>{let n=new u;if(n.orientation=`horizontal`,n.className=`adw-toggle-button`,n.horizontalAlignment=`center`,e.icon){let t=new r;t.className=`${t.className} adw-toggle-icon`.trim(),t.verticalAlignment=`middle`,t.iconName=e.icon,n.addChild(t)}let i=new l;i.text=e.label,i.className=`adw-toggle-label`,i.verticalAlignment=`middle`,n.addChild(i),n.addEventListener(`tap`,()=>{this._state.setSelected(t)}),this.addChild(n),this._segments.push(n)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.ToggleGroup takes only Adw.Toggle children, not \`${t.constructor.name}\`.`);let n=this._toggles.length;this._rebuild([...this._toggles,{label:t.label,icon:t.iconName??void 0,name:t.name===``?null:t.name}]),this._toggles.length===n&&console.warn(`[AdwToggleGroup] a toggle named '${t.name}' already exists; this one is not added`),this._applyPending(!0)}_applyPending(e){if(this._pendingActive!==null&&this._pendingActive<this._toggles.length){let e=this._pendingActive;this._pendingActive=null,this._state.setSelected(e)}if(this._pendingActiveName!==null){let t=c(this._toggles.map(e=>e.name),this._pendingActiveName);e||(this._pendingActiveName=null),t!==-1&&this._state.setSelected(t)}}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(e){let n=t(e,this.active);if(n>=this._toggles.length){this._pendingActive=n;return}this._state.setSelected(n)}get activeName(){return this._toggles[this.active]?.name??null}set activeName(e){this._pendingActiveName=e,this._applyPending(!0)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,d as NOTIFY_SELECTED,a as ToggleGroupState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlBoolean as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{withSignals as i}from"./signals.js";import{defaultToolbarViewProps as a,toolbarViewClassNames as o}from"./chrome.js";import{NO_INSETS as s,insetsOwedBy as c,toolbarViewInsetPadding as l,withKeyboard as u}from"./window-insets.js";import{resolveHostInsets as d}from"./host-insets.js";import{observeWindowInsets as f}from"./window-insets-source.js";import{observeSystemBars as p}from"./system-bars-source.js";import{insetsForEdges as m,resolveEdges as h,systemBarsConfig as g}from"./system-bars.js";import{GridLayout as _,ItemSpec as v,StackLayout as y}from"@nativescript/core";const b={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},x=[`topBar`,`bottomBar`,`content`,`top`,`bottom`];var AdwToolbarView=class extends i(_){static GTypeName=`AdwToolbarView`;static builderSlots=e(x,`content`);_topBox;_bottomBox;_content=null;_props=a();_insets=s;_topBarCount=0;_bottomBarCount=0;_bottomBarShown=!1;_detachInsets=null;_detachBars=null;_detachConfig=null;_systemInsets=null;constructor(e){super(),this.className=b.view,this.addColumn(new v(1,`star`)),this.addRow(new v(1,`auto`)),this.addRow(new v(1,`star`)),this.addRow(new v(1,`auto`));let t=new y;t.orientation=`vertical`,t.className=b.topBar,_.setRow(t,0),this.addChild(t),this._topBox=t;let n=new y;n.orientation=`vertical`,n.className=b.bottomBar,_.setRow(n,2),this.addChild(n),this._bottomBox=n,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),n.addEventListener(`layoutChanged`,()=>{this._bottomBarCount>0&&this._hasShownBottomBar()!==this._bottomBarShown&&this._applyInsets(this._insets)}),this.addEventListener(`loaded`,()=>{this._detachInsets??=f(e=>this._applyInsets(e)),this._detachBars??=p(),this._detachConfig??=g.subscribe(()=>this._applyInsets(this._insets))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null,this._detachBars?.(),this._detachBars=null,this._detachConfig?.(),this._detachConfig=null}),r(this,e)}add_top_bar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}add_bottom_bar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}set_content(e){this._content&&=(this.removeChild(this._content),null),e&&(_.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,n){switch(t(e,x,`content`)){case`topBar`:case`top`:this.add_top_bar(n);return;case`bottomBar`:case`bottom`:this.add_bottom_bar(n);return;default:this.set_content(n)}}get content(){return this._content}set content(e){this.set_content(e)}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}get systemInsets(){return this._systemInsets}set systemInsets(e){if(typeof e==`string`){let t=/^\s*(true|false)\s*$/i.test(e);this._systemInsets=t?n(e,!0):null}else this._systemInsets=e;this._applyInsets(this._insets)}get topBarStyle(){return this._props.topBarStyle}set topBarStyle(e){this._props.topBarStyle=e,this._syncClasses()}get bottomBarStyle(){return this._props.bottomBarStyle}set bottomBarStyle(e){this._props.bottomBarStyle=e,this._syncClasses()}get extendContentToTopEdge(){return this._props.extendContentToTopEdge}set extendContentToTopEdge(e){let t=n(e,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!t,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(e){let t=n(e,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!t,this._applyBarPlacement()}_applyBarPlacement(){_.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,_.setRow(this._bottomBox,this._props.extendContentToBottomEdge?1:2),this._bottomBox.verticalAlignment=this._props.extendContentToBottomEdge?`bottom`:`stretch`,this._restackBars(),this._syncClasses()}_restackBars(){if(!(!this._props.extendContentToTopEdge&&!this._props.extendContentToBottomEdge))for(let e of[this._topBox,this._bottomBox])this.removeChild(e),this.addChild(e)}_hasShownBottomBar(){for(let e=0;e<this._bottomBox.getChildrenCount();e++)if(this._bottomBox.getChildAt(e).visibility===`visible`)return!0;return!1}_applyInsets(e){this._insets=e;let t=h(this._systemInsets,g.bars.insets),n=this._hasShownBottomBar(),r=l(m(c(u(e),d(this,e)),t),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0,bottomBarShown:n});this._bottomBarShown=n,this._topBox.paddingTop=r.topBarTop,this._bottomBox.paddingBottom=r.bottomBarBottom,this.paddingTop=r.contentTop,this.paddingBottom=r.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=o({view:this.className,topBar:this._topBox.className,bottomBar:this._bottomBox.className},this._props,e);this.className!==t.view&&(this.className=t.view),this._topBox.className!==t.topBar&&(this._topBox.className=t.topBar),this._bottomBox.className!==t.bottomBar&&(this._bottomBox.className=t.bottomBar)}};export{AdwToolbarView};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlBoolean as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{defaultToolbarViewProps as a,toolbarViewClassNames as o}from"./chrome.js";import{NO_INSETS as s,insetsOwedBy as c,toolbarViewInsetPadding as l,withKeyboard as u}from"./window-insets.js";import{resolveHostInsets as d}from"./host-insets.js";import{observeWindowInsets as f}from"./window-insets-source.js";import{observeSystemBars as p}from"./system-bars-source.js";import{insetsForEdges as m,resolveEdges as h,systemBarsConfig as g}from"./system-bars.js";import{GridLayout as _,ItemSpec as v,StackLayout as y}from"@nativescript/core";const b={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},x=[`topBar`,`bottomBar`,`content`,`top`,`bottom`];var AdwToolbarView=class extends i(_){static GTypeName=`AdwToolbarView`;static builderSlots=e(x,`content`);_topBox;_bottomBox;_content=null;_props=a();_insets=s;_topBarCount=0;_bottomBarCount=0;_bottomBarShown=!1;_detachInsets=null;_detachBars=null;_detachConfig=null;_systemInsets=null;constructor(e){super(),this.className=b.view,this.addColumn(new v(1,`star`)),this.addRow(new v(1,`auto`)),this.addRow(new v(1,`star`)),this.addRow(new v(1,`auto`));let t=new y;t.orientation=`vertical`,t.className=b.topBar,_.setRow(t,0),this.addChild(t),this._topBox=t;let r=new y;r.orientation=`vertical`,r.className=b.bottomBar,_.setRow(r,2),this.addChild(r),this._bottomBox=r,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),r.addEventListener(`layoutChanged`,()=>{this._bottomBarCount>0&&this._hasShownBottomBar()!==this._bottomBarShown&&this._applyInsets(this._insets)}),this.addEventListener(`loaded`,()=>{this._detachInsets??=f(e=>this._applyInsets(e)),this._detachBars??=p(),this._detachConfig??=g.subscribe(()=>this._applyInsets(this._insets))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null,this._detachBars?.(),this._detachBars=null,this._detachConfig?.(),this._detachConfig=null}),n(this,e)}add_top_bar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}add_bottom_bar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}set_content(e){this._content&&=(this.removeChild(this._content),null),e&&(_.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,n){switch(t(e,x,`content`)){case`topBar`:case`top`:this.add_top_bar(n);return;case`bottomBar`:case`bottom`:this.add_bottom_bar(n);return;default:this.set_content(n)}}get content(){return this._content}set content(e){this.set_content(e)}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}get systemInsets(){return this._systemInsets}set systemInsets(e){if(typeof e==`string`){let t=/^\s*(true|false)\s*$/i.test(e);this._systemInsets=t?r(e,!0):null}else this._systemInsets=e;this._applyInsets(this._insets)}get topBarStyle(){return this._props.topBarStyle}set topBarStyle(e){this._props.topBarStyle=e,this._syncClasses()}get bottomBarStyle(){return this._props.bottomBarStyle}set bottomBarStyle(e){this._props.bottomBarStyle=e,this._syncClasses()}get extendContentToTopEdge(){return this._props.extendContentToTopEdge}set extendContentToTopEdge(e){let t=r(e,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!t,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(e){let t=r(e,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!t,this._applyBarPlacement()}_applyBarPlacement(){_.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,_.setRow(this._bottomBox,this._props.extendContentToBottomEdge?1:2),this._bottomBox.verticalAlignment=this._props.extendContentToBottomEdge?`bottom`:`stretch`,this._restackBars(),this._syncClasses()}_restackBars(){if(!(!this._props.extendContentToTopEdge&&!this._props.extendContentToBottomEdge))for(let e of[this._topBox,this._bottomBox])this.removeChild(e),this.addChild(e)}_hasShownBottomBar(){for(let e=0;e<this._bottomBox.getChildrenCount();e++)if(this._bottomBox.getChildAt(e).visibility===`visible`)return!0;return!1}_applyInsets(e){this._insets=e;let t=h(this._systemInsets,g.bars.insets),n=this._hasShownBottomBar(),r=l(m(c(u(e),d(this,e)),t),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0,bottomBarShown:n});this._bottomBarShown=n,this._topBox.paddingTop=r.topBarTop,this._bottomBox.paddingBottom=r.bottomBarBottom,this.paddingTop=r.contentTop,this.paddingBottom=r.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=o({view:this.className,topBar:this._topBox.className,bottomBar:this._bottomBox.className},this._props,e);this.className!==t.view&&(this.className=t.view),this._topBox.className!==t.topBar&&(this._topBox.className=t.topBar),this._bottomBox.className!==t.bottomBar&&(this._bottomBox.className=t.bottomBar)}};export{AdwToolbarView};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{resolveIdReference as a}from"./id-reference.js";import{AdwViewStack as o,NOTIFY_VISIBLE_CHILD as s}from"./adw-view-stack.js";import{createViewSwitcherBarState as c}from"./view-switcher-model.js";import{buildViewSwitcherButtons as l,viewSwitcherPagesFromStack as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f,Label as p,StackLayout as m}from"@nativescript/core";var AdwViewSwitcherBar=class extends n(d){static GTypeName=`AdwViewSwitcherBar`;static builderReferences=[`stack`];_bar;_nodes=[];_stack=null;_stackId=null;_stackListener=null;_barState=c();constructor(e){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`auto`));let n=new d;n.className=`adw-viewswitcherbar-box`,n.addRow(new f(1,`auto`)),d.setRow(n,0),this.addChild(n),this._bar=n,this._barState.subscribe(()=>this._applyRevealed()),this._applyRevealed(),this.addEventListener(`loaded`,()=>{this._stackId!==null&&(this.stack=a(this,`stack`,this._stackId,o)),this._bindStack(),this._rebuild()}),this.addEventListener(`unloaded`,()=>this._unbindStack()),t(this,e)}set_stack(e){this._unbindStack(),this._stack=e,this._bindStack(),this._rebuild()}get stack(){return this._stack}set stack(e){if(typeof e==`string`){this._stackId=e,this.isLoaded&&(this.stack=a(this,`stack`,e,o));return}this._stackId=null,this.set_stack(e)}get reveal(){return this._barState.reveal}set reveal(t){let n=e(t,this.reveal);this._barState.setReveal(n)}get revealed(){return this._barState.revealed}refresh(){this._rebuild()}_bindStack(){if(!this._stack||this._stackListener)return;let listener=()=>this._rebuild();this._stack.addEventListener(s,listener),this._stackListener=listener}_unbindStack(){!this._stack||!this._stackListener||(this._stack.removeEventListener(s,this._stackListener),this._stackListener=null)}_rebuild(){let e=this._stack?.pages??[];this._barState.setPages(e);let t=this._stack?.pageIcons()??[],n=l(u(e).map((e,n)=>({...e,iconName:(t[n]??``).length>0?t[n]:e.iconName})),this._stack?.visibleChildIndex??-1,`narrow`);if(n.length!==this._nodes.length){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns(),this._nodes=n.map((e,t)=>(this._bar.addColumn(new f(1,`star`)),this._buildButton(e.pageIndex,t)))}n.forEach((e,t)=>{let n=this._nodes[t];n&&(n.button.visibility=e.visible?`visible`:`collapse`,n.button.className=e.selected?`adw-viewswitcherbar-button active`:`adw-viewswitcherbar-button`,n.icon.iconName=e.iconName,n.label.text=e.label,n.badge.text=e.badgeLabel,n.badge.visibility=e.badgeLabel.length>0||e.needsAttention?`visible`:`collapse`,n.badge.className=e.badgeLabel.length===0&&e.needsAttention?`adw-viewswitcherbar-button-badge needs-attention`:`adw-viewswitcherbar-button-badge`)}),this._applyRevealed()}_buildButton(e,t){let n=new m;n.orientation=`vertical`,n.className=`adw-viewswitcherbar-button`,n.horizontalAlignment=`stretch`;let a=new r;a.className=`${a.className} adw-viewswitcherbar-button-icon`.trim(),a.horizontalAlignment=`center`,n.addChild(a);let o=new p;o.className=`adw-viewswitcherbar-button-label`,o.horizontalAlignment=`center`,o.textAlignment=`center`,n.addChild(o);let s=new p;return s.className=`adw-viewswitcherbar-button-badge`,s.horizontalAlignment=`center`,s.textAlignment=`center`,n.addChild(s),i(n),n.addEventListener(`tap`,()=>{this._stack?.selectNthPage(e)}),d.setColumn(n,t),this._bar.addChild(n),{button:n,icon:a,label:o,badge:s}}_applyRevealed(){this.visibility=this._barState.revealed?`visible`:`collapse`,this.parent?.requestLayout()}};export{AdwViewSwitcherBar};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{resolveIdReference as a}from"./id-reference.js";import{AdwViewStack as o,NOTIFY_VISIBLE_CHILD as s}from"./adw-view-stack.js";import{createViewSwitcherBarState as c}from"./view-switcher-model.js";import{buildViewSwitcherButtons as l,viewSwitcherPagesFromStack as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f,Label as p,StackLayout as m}from"@nativescript/core";var AdwViewSwitcherBar=class extends n(d){static GTypeName=`AdwViewSwitcherBar`;static builderReferences=[`stack`];_bar;_nodes=[];_stack=null;_stackId=null;_stackListener=null;_barState=c();constructor(t){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`auto`));let n=new d;n.className=`adw-viewswitcherbar-box`,n.addRow(new f(1,`auto`)),d.setRow(n,0),this.addChild(n),this._bar=n,this._barState.subscribe(()=>this._applyRevealed()),this._applyRevealed(),this.addEventListener(`loaded`,()=>{this._stackId!==null&&(this.stack=a(this,`stack`,this._stackId,o)),this._bindStack(),this._rebuild()}),this.addEventListener(`unloaded`,()=>this._unbindStack()),e(this,t)}set_stack(e){this._unbindStack(),this._stack=e,this._bindStack(),this._rebuild()}get stack(){return this._stack}set stack(e){if(typeof e==`string`){this._stackId=e,this.isLoaded&&(this.stack=a(this,`stack`,e,o));return}this._stackId=null,this.set_stack(e)}get reveal(){return this._barState.reveal}set reveal(e){let n=t(e,this.reveal);this._barState.setReveal(n)}get revealed(){return this._barState.revealed}refresh(){this._rebuild()}_bindStack(){if(!this._stack||this._stackListener)return;let listener=()=>this._rebuild();this._stack.addEventListener(s,listener),this._stackListener=listener}_unbindStack(){!this._stack||!this._stackListener||(this._stack.removeEventListener(s,this._stackListener),this._stackListener=null)}_rebuild(){let e=this._stack?.pages??[];this._barState.setPages(e);let t=this._stack?.pageIcons()??[],n=l(u(e).map((e,n)=>({...e,iconName:(t[n]??``).length>0?t[n]:e.iconName})),this._stack?.visibleChildIndex??-1,`narrow`);if(n.length!==this._nodes.length){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns(),this._nodes=n.map((e,t)=>(this._bar.addColumn(new f(1,`star`)),this._buildButton(e.pageIndex,t)))}n.forEach((e,t)=>{let n=this._nodes[t];n&&(n.button.visibility=e.visible?`visible`:`collapse`,n.button.className=e.selected?`adw-viewswitcherbar-button active`:`adw-viewswitcherbar-button`,n.icon.iconName=e.iconName,n.label.text=e.label,n.badge.text=e.badgeLabel,n.badge.visibility=e.badgeLabel.length>0||e.needsAttention?`visible`:`collapse`,n.badge.className=e.badgeLabel.length===0&&e.needsAttention?`adw-viewswitcherbar-button-badge needs-attention`:`adw-viewswitcherbar-button-badge`)}),this._applyRevealed()}_buildButton(e,t){let n=new m;n.orientation=`vertical`,n.className=`adw-viewswitcherbar-button`,n.horizontalAlignment=`stretch`;let a=new r;a.className=`${a.className} adw-viewswitcherbar-button-icon`.trim(),a.horizontalAlignment=`center`,n.addChild(a);let o=new p;o.className=`adw-viewswitcherbar-button-label`,o.horizontalAlignment=`center`,o.textAlignment=`center`,n.addChild(o);let s=new p;return s.className=`adw-viewswitcherbar-button-badge`,s.horizontalAlignment=`center`,s.textAlignment=`center`,n.addChild(s),i(n),n.addEventListener(`tap`,()=>{this._stack?.selectNthPage(e)}),d.setColumn(n,t),this._bar.addChild(n),{button:n,icon:a,label:o,badge:s}}_applyRevealed(){this.visibility=this._barState.revealed?`visible`:`collapse`,this.parent?.requestLayout()}};export{AdwViewSwitcherBar};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{DEFAULT_WRAP_BOX_SPACING as i,normalizeWrapBoxSpacing as a,wrapBoxChildFlex as o,wrapBoxChildMargin as s,wrapBoxFlexStyle as c,wrapBoxSpacingChanges as l}from"./wrap-box-layout.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as u,ADW_WRAP_BOX_DEFAULT_JUSTIFY as d,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as f,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as p,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as m,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as h,normalizeNaturalLineLength as g,normalizeWrapBoxAlign as _,normalizeWrapBoxJustify as v,normalizeWrapBoxLengthUnit as y,normalizeWrapBoxPackDirection as b,normalizeWrapPolicy as x,resolveWrapBoxChildOrder as S,wrapBoxLengthToPx as C}from"@gjsify/adwaita-core";import{FlexboxLayout as w}from"@nativescript/core";var AdwWrapBox=class extends r(w){static GTypeName=`AdwWrapBox`;_childSpacing=i;_lineSpacing=i;_childSpacingUnit=f;_lineSpacingUnit=f;_align=u;_justify=d;_justifyLastLine=!1;_lineHomogeneous=!1;_wrapReverse=!1;_wrapPolicy=m;_packDirection=p;_orientation=`horizontal`;_naturalLineLength=h;_naturalLineLengthUnit=f;constructor(e){super(),this.className=`adw-wrap-box`,this._applyLayout(),n(this,e)}append(e){this.addChild(e)}remove(e){this.removeChild(e)}remove_all(){this.removeChildren()}addChild(e){super.addChild(e),this._applyChildren()}insert_child_after(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorder_child_after(e,t=null){return this._applyOrder(`reorder-after`,e,t)}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_applyOrder(e,t,n){let r=this._childViews(),i=S({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),this._applyChildren(),!0)}get childSpacing(){return this._childSpacing}set childSpacing(e){let n=t(e,this._childSpacing);l(this._childSpacing,n)&&(this._childSpacing=a(n),this._applyChildren(),this._notify(`child-spacing`))}get childSpacingUnit(){return this._childSpacingUnit}set childSpacingUnit(e){let t=y(e);t!==this._childSpacingUnit&&(this._childSpacingUnit=t,this._applyChildren(),this._notify(`child-spacing-unit`))}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){let n=t(e,this._lineSpacing);l(this._lineSpacing,n)&&(this._lineSpacing=a(n),this._applyChildren(),this._notify(`line-spacing`))}get lineSpacingUnit(){return this._lineSpacingUnit}set lineSpacingUnit(e){let t=y(e);t!==this._lineSpacingUnit&&(this._lineSpacingUnit=t,this._applyChildren(),this._notify(`line-spacing-unit`))}get align(){return this._align}set align(e){let n=_(t(e,this.align));n!==this._align&&(this._align=n,this._applyLayout(),this._notify(`align`))}get justify(){return this._justify}set justify(e){let t=v(e);t!==this._justify&&(this._justify=t,this._applyLayout(),this._notify(`justify`))}get justifyLastLine(){return this._justifyLastLine}set justifyLastLine(t){let n=!!e(t,this.justifyLastLine);n!==this._justifyLastLine&&(this._justifyLastLine=n,this._applyLayout(),this._notify(`justify-last-line`))}get lineHomogeneous(){return this._lineHomogeneous}set lineHomogeneous(t){let n=!!e(t,this.lineHomogeneous);n!==this._lineHomogeneous&&(this._lineHomogeneous=n,this._applyLayout(),this._notify(`line-homogeneous`))}get wrapReverse(){return this._wrapReverse}set wrapReverse(t){let n=!!e(t,this.wrapReverse);n!==this._wrapReverse&&(this._wrapReverse=n,this._applyLayout(),this._notify(`wrap-reverse`))}get wrapPolicy(){return this._wrapPolicy}set wrapPolicy(e){let t=x(e);t!==this._wrapPolicy&&(this._wrapPolicy=t,this._applyLayout(),this._notify(`wrap-policy`))}get packDirection(){return this._packDirection}set packDirection(e){let t=b(e);t!==this._packDirection&&(this._packDirection=t,this._applyLayout(),this._notify(`pack-direction`))}get orientation(){return this._orientation}set orientation(e){let t=e===`vertical`?`vertical`:`horizontal`;t!==this._orientation&&(this._orientation=t,this._applyLayout(),this._notify(`orientation`))}get naturalLineLength(){return this._naturalLineLength}set naturalLineLength(e){let n=g(t(e,this.naturalLineLength));n!==this._naturalLineLength&&(this._naturalLineLength=n,this._notify(`natural-line-length`))}get naturalLineLengthUnit(){return this._naturalLineLengthUnit}set naturalLineLengthUnit(e){let t=y(e);t!==this._naturalLineLengthUnit&&(this._naturalLineLengthUnit=t,this._notify(`natural-line-length-unit`))}get naturalLineLengthPx(){return C(this._naturalLineLength,this._naturalLineLengthUnit)}_notify(e){this.notify({eventName:`notify::${e}`,object:this})}_flexInput(){return{orientation:this._orientation,packDirection:this._packDirection,wrapReverse:this._wrapReverse,justify:this._justify,justifyLastLine:this._justifyLastLine,align:this._align,lineHomogeneous:this._lineHomogeneous,wrapPolicy:this._wrapPolicy}}_applyLayout(){let e=c(this._flexInput());this.flexDirection=e.flexDirection,this.flexWrap=e.flexWrap,this.justifyContent=e.justifyContent,this.alignContent=e.alignContent,this.alignItems=`stretch`,this._applyChildren()}_applyChildren(){let e=s(C(this._childSpacing,this._childSpacingUnit),C(this._lineSpacing,this._lineSpacingUnit)),t=this._childViews(),n=o(this._flexInput(),t.length);for(let r of t)r.set(`margin`,e),w.setFlexGrow(r,n.flexGrow),w.setFlexShrink(r,n.flexShrink)}};export{AdwWrapBox};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{DEFAULT_WRAP_BOX_SPACING as i,normalizeWrapBoxSpacing as a,wrapBoxChildFlex as o,wrapBoxChildMargin as s,wrapBoxFlexStyle as c,wrapBoxSpacingChanges as l}from"./wrap-box-layout.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as u,ADW_WRAP_BOX_DEFAULT_JUSTIFY as d,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as f,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as p,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as m,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as h,normalizeNaturalLineLength as g,normalizeWrapBoxAlign as _,normalizeWrapBoxJustify as v,normalizeWrapBoxLengthUnit as y,normalizeWrapBoxPackDirection as b,normalizeWrapPolicy as x,resolveWrapBoxChildOrder as S,wrapBoxLengthToPx as C}from"@gjsify/adwaita-core";import{FlexboxLayout as w}from"@nativescript/core";var AdwWrapBox=class extends r(w){static GTypeName=`AdwWrapBox`;_childSpacing=i;_lineSpacing=i;_childSpacingUnit=f;_lineSpacingUnit=f;_align=u;_justify=d;_justifyLastLine=!1;_lineHomogeneous=!1;_wrapReverse=!1;_wrapPolicy=m;_packDirection=p;_orientation=`horizontal`;_naturalLineLength=h;_naturalLineLengthUnit=f;constructor(t){super(),this.className=`adw-wrap-box`,this._applyLayout(),e(this,t)}append(e){this.addChild(e)}remove(e){this.removeChild(e)}remove_all(){this.removeChildren()}addChild(e){super.addChild(e),this._applyChildren()}insert_child_after(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorder_child_after(e,t=null){return this._applyOrder(`reorder-after`,e,t)}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_applyOrder(e,t,n){let r=this._childViews(),i=S({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),this._applyChildren(),!0)}get childSpacing(){return this._childSpacing}set childSpacing(e){let t=n(e,this._childSpacing);l(this._childSpacing,t)&&(this._childSpacing=a(t),this._applyChildren(),this._notify(`child-spacing`))}get childSpacingUnit(){return this._childSpacingUnit}set childSpacingUnit(e){let t=y(e);t!==this._childSpacingUnit&&(this._childSpacingUnit=t,this._applyChildren(),this._notify(`child-spacing-unit`))}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){let t=n(e,this._lineSpacing);l(this._lineSpacing,t)&&(this._lineSpacing=a(t),this._applyChildren(),this._notify(`line-spacing`))}get lineSpacingUnit(){return this._lineSpacingUnit}set lineSpacingUnit(e){let t=y(e);t!==this._lineSpacingUnit&&(this._lineSpacingUnit=t,this._applyChildren(),this._notify(`line-spacing-unit`))}get align(){return this._align}set align(e){let t=_(n(e,this.align));t!==this._align&&(this._align=t,this._applyLayout(),this._notify(`align`))}get justify(){return this._justify}set justify(e){let t=v(e);t!==this._justify&&(this._justify=t,this._applyLayout(),this._notify(`justify`))}get justifyLastLine(){return this._justifyLastLine}set justifyLastLine(e){let n=!!t(e,this.justifyLastLine);n!==this._justifyLastLine&&(this._justifyLastLine=n,this._applyLayout(),this._notify(`justify-last-line`))}get lineHomogeneous(){return this._lineHomogeneous}set lineHomogeneous(e){let n=!!t(e,this.lineHomogeneous);n!==this._lineHomogeneous&&(this._lineHomogeneous=n,this._applyLayout(),this._notify(`line-homogeneous`))}get wrapReverse(){return this._wrapReverse}set wrapReverse(e){let n=!!t(e,this.wrapReverse);n!==this._wrapReverse&&(this._wrapReverse=n,this._applyLayout(),this._notify(`wrap-reverse`))}get wrapPolicy(){return this._wrapPolicy}set wrapPolicy(e){let t=x(e);t!==this._wrapPolicy&&(this._wrapPolicy=t,this._applyLayout(),this._notify(`wrap-policy`))}get packDirection(){return this._packDirection}set packDirection(e){let t=b(e);t!==this._packDirection&&(this._packDirection=t,this._applyLayout(),this._notify(`pack-direction`))}get orientation(){return this._orientation}set orientation(e){let t=e===`vertical`?`vertical`:`horizontal`;t!==this._orientation&&(this._orientation=t,this._applyLayout(),this._notify(`orientation`))}get naturalLineLength(){return this._naturalLineLength}set naturalLineLength(e){let t=g(n(e,this.naturalLineLength));t!==this._naturalLineLength&&(this._naturalLineLength=t,this._notify(`natural-line-length`))}get naturalLineLengthUnit(){return this._naturalLineLengthUnit}set naturalLineLengthUnit(e){let t=y(e);t!==this._naturalLineLengthUnit&&(this._naturalLineLengthUnit=t,this._notify(`natural-line-length-unit`))}get naturalLineLengthPx(){return C(this._naturalLineLength,this._naturalLineLengthUnit)}_notify(e){this.notify({eventName:`notify::${e}`,object:this})}_flexInput(){return{orientation:this._orientation,packDirection:this._packDirection,wrapReverse:this._wrapReverse,justify:this._justify,justifyLastLine:this._justifyLastLine,align:this._align,lineHomogeneous:this._lineHomogeneous,wrapPolicy:this._wrapPolicy}}_applyLayout(){let e=c(this._flexInput());this.flexDirection=e.flexDirection,this.flexWrap=e.flexWrap,this.justifyContent=e.justifyContent,this.alignContent=e.alignContent,this.alignItems=`stretch`,this._applyChildren()}_applyChildren(){let e=s(C(this._childSpacing,this._childSpacingUnit),C(this._lineSpacing,this._lineSpacingUnit)),t=this._childViews(),n=o(this._flexInput(),t.length);for(let r of t)r.set(`margin`,e),w.setFlexGrow(r,n.flexGrow),w.setFlexShrink(r,n.flexShrink)}};export{AdwWrapBox};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{nativePlatformHost as e}from"../platform-host.js";import{GioApplicationBase as t,defineWindowApplicationMembers as n,dispatchAccelerator as r,withGtkApplication as i}from"@gjsify/adwaita-core";import{Application as a,GridLayout as o}from"@nativescript/core";const s={name:`adwaita-nativescript`,requiresWindow:!0,start(e){return new Promise(t=>{a.run({create(){let n=e();return t(),n??new o}})})},detach(){},exit(){a.android?.foregroundActivity?.finish?.()}};var GioApplication=class extends t{static host=s},GtkApplication=class extends i(GioApplication){static GTypeName=`GtkApplication`},AdwApplication=class extends GtkApplication{static GTypeName=`AdwApplication`};const c=`notify::application`,l=new WeakMap,parentOf=e=>e.parent;function followAccelerators(t,n){l.get(t)?.(),l.delete(t),n!==null&&l.set(t,e.listenKeys(t,e=>r(t,e,parentOf)))}function defineWindowApplication(e){n(e,(e,t)=>{followAccelerators(e,t),e.notify({eventName:c,object:e,value:t})})}export{AdwApplication,GioApplication,GtkApplication,c as NOTIFY_APPLICATION,defineWindowApplication,s as nativeScriptHost};
1
+ import"../_virtual/_rolldown/runtime.js";import{nativePlatformHost as e}from"../platform-host.js";import{IconTheme as t}from"../namespace/gtk-platform.js";import{GioApplicationBase as n,defineWindowApplicationMembers as r,dispatchAccelerator as i,withGtkApplication as a}from"@gjsify/adwaita-core";import{Application as o,GridLayout as s}from"@nativescript/core";const c={name:`adwaita-nativescript`,requiresWindow:!0,iconTheme:()=>t.get_for_display(null),start(e){return new Promise(t=>{o.run({create(){let n=e();return t(),n??new s}})})},detach(){},exit(){o.android?.foregroundActivity?.finish?.()}};var GioApplication=class extends n{static host=c},GtkApplication=class extends a(GioApplication){static GTypeName=`GtkApplication`},AdwApplication=class extends GtkApplication{static GTypeName=`AdwApplication`};const l=`notify::application`,u=new WeakMap,parentOf=e=>e.parent;function followAccelerators(t,n){u.get(t)?.(),u.delete(t),n!==null&&u.set(t,e.listenKeys(t,e=>i(t,e,parentOf)))}function defineWindowApplication(e){r(e,(e,t)=>{followAccelerators(e,t),e.notify({eventName:l,object:e,value:t})})}export{AdwApplication,GioApplication,GtkApplication,l as NOTIFY_APPLICATION,defineWindowApplication,c as nativeScriptHost};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlBoolean as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{withSignals as i}from"./signals.js";import{GridLayout as a,ItemSpec as o,StackLayout as s}from"@nativescript/core";const c=[`start`,`center`,`end`];var GtkActionBar=class extends i(a){static GTypeName=`GtkActionBar`;static builderSlots=e(c,`start`);_startBox;_endBox;_centerWidget=null;_revealed=!0;constructor(e){super(),this.className=`adw-action-bar`,this.addColumn(new o(1,`star`)),this.addColumn(new o(1,`auto`)),this.addColumn(new o(1,`star`)),this.addRow(new o(1,`auto`));let t=new s;t.orientation=`horizontal`,t.className=`adw-action-bar-start`,t.horizontalAlignment=`left`,a.setColumn(t,0),this.addChild(t),this._startBox=t;let n=new s;n.orientation=`horizontal`,n.className=`adw-action-bar-end`,n.horizontalAlignment=`right`,a.setColumn(n,2),this.addChild(n),this._endBox=n,r(this,e)}pack_start(e){this._startBox.addChild(e)}pack_end(e){this._endBox.insertChild(e,0)}set_center_widget(e){this._centerWidget&&this.removeChild(this._centerWidget),this._centerWidget=e,e&&(e.verticalAlignment=`middle`,a.setColumn(e,1),this.addChild(e))}get centerWidget(){return this._centerWidget}get startBox(){return this._startBox}get endBox(){return this._endBox}_addChildFromBuilder(e,n){switch(t(e,c,`start`)){case`center`:this.set_center_widget(n);return;case`end`:this.pack_end(n);return;default:this.pack_start(n)}}get revealed(){return this._revealed}set revealed(e){this._revealed=n(e,this._revealed),this.visibility=this._revealed?`visible`:`collapse`}};export{GtkActionBar};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlBoolean as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{GridLayout as a,ItemSpec as o,StackLayout as s}from"@nativescript/core";const c=[`start`,`center`,`end`];var GtkActionBar=class extends i(a){static GTypeName=`GtkActionBar`;static builderSlots=e(c,`start`);_startBox;_endBox;_centerWidget=null;_revealed=!0;constructor(e){super(),this.className=`adw-action-bar`,this.addColumn(new o(1,`star`)),this.addColumn(new o(1,`auto`)),this.addColumn(new o(1,`star`)),this.addRow(new o(1,`auto`));let t=new s;t.orientation=`horizontal`,t.className=`adw-action-bar-start`,t.horizontalAlignment=`left`,a.setColumn(t,0),this.addChild(t),this._startBox=t;let r=new s;r.orientation=`horizontal`,r.className=`adw-action-bar-end`,r.horizontalAlignment=`right`,a.setColumn(r,2),this.addChild(r),this._endBox=r,n(this,e)}pack_start(e){this._startBox.addChild(e)}pack_end(e){this._endBox.insertChild(e,0)}set_center_widget(e){this._centerWidget&&this.removeChild(this._centerWidget),this._centerWidget=e,e&&(e.verticalAlignment=`middle`,a.setColumn(e,1),this.addChild(e))}get centerWidget(){return this._centerWidget}get startBox(){return this._startBox}get endBox(){return this._endBox}_addChildFromBuilder(e,n){switch(t(e,c,`start`)){case`center`:this.set_center_widget(n);return;case`end`:this.pack_end(n);return;default:this.pack_start(n)}}get revealed(){return this._revealed}set revealed(e){this._revealed=r(e,this._revealed),this.visibility=this._revealed?`visible`:`collapse`}};export{GtkActionBar};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{NOTIFY_HEXPAND as r,NOTIFY_VEXPAND as i}from"./widget-layout.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{DEFAULT_BOX_SPACING as o,boxChildTrack as s,boxSpacingChanges as c,boxTrackPlan as l,normalizeBoxSpacing as u,resolveBoxChildOrder as d}from"./box-layout.js";import{normalizeBoxOrientation as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m}from"@nativescript/core";var GtkBox=class extends a{static GTypeName=`GtkBox`;_spacing=o;_orientation=`horizontal`;_homogeneous=!1;_trackKey=``;_followers=new Map;constructor(e){super(),n(this,e)}append(e){this.addChild(e)}prepend(e){this.insertChild(e,0)}remove(e){this.removeChild(e)}addChild(e){super.addChild(e),this._follow(e),this._applyChildren()}insertChild(e,t){let n=super.insertChild(e,t);return this._follow(e),this._applyChildren(),n}removeChild(e){this._unfollow(e),super.removeChild(e),this._applyChildren()}insert_child_after(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorder_child_after(e,t=null){return this._applyOrder(`reorder-after`,e,t)}get spacing(){return this._spacing}set spacing(e){let n=t(e,this._spacing);c(this._spacing,n)&&(this._spacing=u(n),this._applyChildren(),this.notify({eventName:`notify::spacing`,object:this}))}get orientation(){return this._orientation}set orientation(e){let t=f(e===1?`vertical`:e);t!==this._orientation&&(this._orientation=t,this._applyChildren(),this.notify({eventName:`notify::orientation`,object:this}))}get homogeneous(){return this._homogeneous}set homogeneous(t){let n=e(t,this._homogeneous);n!==this._homogeneous&&(this._homogeneous=n,this._applyChildren())}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_applyOrder(e,t,n){let r=this._childViews(),i=d({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),!0)}_follow(e){if(this._followers.has(e))return;let follower=()=>this._applyChildren();this._followers.set(e,follower),e.addEventListener(r,follower),e.addEventListener(i,follower)}_unfollow(e){let t=this._followers.get(e);t!==void 0&&(e.removeEventListener(r,t),e.removeEventListener(i,t),this._followers.delete(e))}_applyChildren(){let e=this._orientation===`vertical`,t=this._childViews(),n=l(t.map(t=>{let n=t;return(e?n.vexpand:n.hexpand)===!0}),this._spacing,this._homogeneous),r=`${e?`v`:`h`}${n.map(({unit:e,value:t})=>`${e}${t}`).join(`,`)}`;if(r!==this._trackKey){this._trackKey=r,this.removeColumns(),this.removeRows();let cross=()=>new m(1,`star`),along=e=>{for(let{unit:t,value:r}of n)e(new m(r,t))};e?(this.addColumn(cross()),along(e=>this.addRow(e))):(this.addRow(cross()),along(e=>this.addColumn(e)))}for(let[n,r]of t.entries())p.setColumn(r,e?0:s(n)),p.setRow(r,e?s(n):0)}};export{o as DEFAULT_BOX_SPACING,GtkBox};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{NOTIFY_HEXPAND as r,NOTIFY_VEXPAND as i}from"./widget-layout.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{DEFAULT_BOX_SPACING as o,boxChildTrack as s,boxSpacingChanges as c,boxTrackPlan as l,normalizeBoxSpacing as u,resolveBoxChildOrder as d}from"./box-layout.js";import{normalizeBoxOrientation as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m}from"@nativescript/core";var GtkBox=class extends a{static GTypeName=`GtkBox`;_spacing=o;_orientation=`horizontal`;_homogeneous=!1;_trackKey=``;_followers=new Map;constructor(t){super(),e(this,t)}append(e){this.addChild(e)}prepend(e){this.insertChild(e,0)}remove(e){this.removeChild(e)}addChild(e){super.addChild(e),this._follow(e),this._applyChildren()}insertChild(e,t){let n=super.insertChild(e,t);return this._follow(e),this._applyChildren(),n}removeChild(e){this._unfollow(e),super.removeChild(e),this._applyChildren()}insert_child_after(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorder_child_after(e,t=null){return this._applyOrder(`reorder-after`,e,t)}get spacing(){return this._spacing}set spacing(e){let t=n(e,this._spacing);c(this._spacing,t)&&(this._spacing=u(t),this._applyChildren(),this.notify({eventName:`notify::spacing`,object:this}))}get orientation(){return this._orientation}set orientation(e){let t=f(e===1?`vertical`:e);t!==this._orientation&&(this._orientation=t,this._applyChildren(),this.notify({eventName:`notify::orientation`,object:this}))}get homogeneous(){return this._homogeneous}set homogeneous(e){let n=t(e,this._homogeneous);n!==this._homogeneous&&(this._homogeneous=n,this._applyChildren())}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_applyOrder(e,t,n){let r=this._childViews(),i=d({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),!0)}_follow(e){if(this._followers.has(e))return;let follower=()=>this._applyChildren();this._followers.set(e,follower),e.addEventListener(r,follower),e.addEventListener(i,follower)}_unfollow(e){let t=this._followers.get(e);t!==void 0&&(e.removeEventListener(r,t),e.removeEventListener(i,t),this._followers.delete(e))}_applyChildren(){let e=this._orientation===`vertical`,t=this._childViews(),n=l(t.map(t=>{let n=t;return(e?n.vexpand:n.hexpand)===!0}),this._spacing,this._homogeneous),r=`${e?`v`:`h`}${n.map(({unit:e,value:t})=>`${e}${t}`).join(`,`)}`;if(r!==this._trackKey){this._trackKey=r,this.removeColumns(),this.removeRows();let cross=()=>new m(1,`star`),along=e=>{for(let{unit:t,value:r}of n)e(new m(r,t))};e?(this.addColumn(cross()),along(e=>this.addRow(e))):(this.addRow(cross()),along(e=>this.addColumn(e)))}for(let[n,r]of t.entries())p.setColumn(r,e?0:s(n)),p.setRow(r,e?s(n):0)}};export{o as DEFAULT_BOX_SPACING,GtkBox};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{activateWidgetAction as r}from"./actions.js";import{applyNativeTooltip as i}from"./native-tooltip.js";import{withSignals as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{classNameWith as s,normalizeStyleClasses as c,withCssClass as l,withoutCssClass as u}from"./style-classes.js";import{attachRowPressFeedback as d}from"./row-press.js";import{buttonSlotAfterWrite as f,buttonSlotDetaches as p}from"./button-slot.js";import{labelDisplayText as m}from"@gjsify/adwaita-core";import{GridLayout as h,ItemSpec as g,Label as _}from"@nativescript/core";const v=`clicked`,y=`image-button`,b=`adw-button-label`;var GtkButton=class extends a(h){static GTypeName=`GtkButton`;static emittedSignals=[v];static builderSlots=e([`child`],`child`);_styleClasses=[];_label=``;_iconName=``;_useUnderline=!1;_slot=`empty`;_content=null;constructor(e){super(),this.className=s(`adw-button`,this._styleClasses),this.addRow(new g(1,`star`)),this.addColumn(new g(1,`star`)),d(this),this.addEventListener(`tap`,()=>{this.notify({eventName:v,object:this}),this.actionName&&r(this,this.actionName)}),this.addEventListener(`loaded`,()=>{i(this,this.tooltipText),this._pinIconColor()}),n(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._fill(`label`,this._label)}actionName=null;get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._fill(`icon`,this._iconName)}get tooltipText(){return this.accessibilityHint??``}set tooltipText(e){this.accessibilityHint=e??``,i(this,this.tooltipText)}get child(){return this._slot===`child`?this._content:null}set child(e){this._fill(`child`,e??null)}set_child(e){this.child=e}get_child(){return this.child}_addChildFromBuilder(e,t){this.child=t}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=t(e,this._useUnderline),this._slot===`label`&&this._fill(`label`,this._label)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(c(e))}add_css_class(e){this._setClasses(l(this._styleClasses,e))}remove_css_class(e){this._setClasses(u(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(c([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this._restyle()}_restyle(){this.className=s(`adw-button`,[...this._styleClasses,...this._stateClasses()]),this._pinIconColor()}_stateClasses(){return this._slot===`icon`?[y]:[]}_fill(e,t){let n=f(e,t);p(this._slot,n)&&this._detach();let r=this._slot===`icon`;if(this._slot=n,r!==(n===`icon`)&&this._restyle(),n===`empty`){this._detach();return}if(n===`child`){let e=t;if(this._content===e)return;this._detach(),this._adopt(e);let n=e;`hostButton`in n&&(n.hostButton=this);return}if(n===`label`){let e=this._content instanceof _?this._content:this._adopt(new _);e.className=b,e.text=m(this._label,!1,this._useUnderline);return}let i=this._content instanceof o?this._content:this._adopt(new o);i.iconName=this._iconName,this._pinIconColor()}_pinIconColor(){this._content instanceof o&&(this._styleClasses.some(e=>e===`osd`||e===`suggested-action`)||this._inOsdContainer())&&(this._content.iconColor=`#ffffff`)}_inOsdContainer(){for(let e=this.parent;e;e=e.parent)if((e.className??``).split(/\s+/).includes(`osd`))return!0;return!1}_detach(){this._content&&this.removeChild(this._content),this._content=null}_adopt(e){return e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,h.setColumn(e,0),h.setRow(e,0),this.addChild(e),this._content=e,e}};export{v as GTK_BUTTON_CLICKED,y as GTK_BUTTON_IMAGE_CLASS,b as GTK_BUTTON_LABEL_CLASS,GtkButton};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n}from"./xml-values.js";import{activateWidgetAction as r}from"./actions.js";import{applyNativeTooltip as i}from"./native-tooltip.js";import{withSignals as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{classNameWith as s,normalizeStyleClasses as c,withCssClass as l,withoutCssClass as u}from"./style-classes.js";import{attachRowPressFeedback as d}from"./row-press.js";import{buttonSlotAfterWrite as f,buttonSlotDetaches as p}from"./button-slot.js";import{labelDisplayText as m}from"@gjsify/adwaita-core";import{GridLayout as h,ItemSpec as g,Label as _}from"@nativescript/core";const v=`clicked`,y=`image-button`,b=`adw-button-label`;var GtkButton=class extends a(h){static GTypeName=`GtkButton`;static emittedSignals=[v];static builderSlots=e([`child`],`child`);_styleClasses=[];_label=``;_iconName=``;_tooltipText=``;_useUnderline=!1;_slot=`empty`;_content=null;constructor(e){super(),this.className=s(`adw-button`,this._styleClasses),this.addRow(new g(1,`star`)),this.addColumn(new g(1,`star`)),d(this),this.addEventListener(`tap`,()=>{this.notify({eventName:v,object:this}),this.actionName&&r(this,this.actionName)}),this.addEventListener(`loaded`,()=>{i(this,this.tooltipText),this._pinIconColor()}),t(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._fill(`label`,this._label)}actionName=null;get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._fill(`icon`,this._iconName)}get tooltipText(){return this._tooltipText}set tooltipText(e){let t=e??``;(this.accessibilityHint??``)===this._tooltipText&&(this.accessibilityHint=t),this._tooltipText=t,i(this,t)}get child(){return this._slot===`child`?this._content:null}set child(e){this._fill(`child`,e??null)}set_child(e){this.child=e}get_child(){return this.child}_addChildFromBuilder(e,t){this.child=t}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=n(e,this._useUnderline),this._slot===`label`&&this._fill(`label`,this._label)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(c(e))}add_css_class(e){this._setClasses(l(this._styleClasses,e))}remove_css_class(e){this._setClasses(u(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(c([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this._restyle()}_restyle(){this.className=s(`adw-button`,[...this._styleClasses,...this._stateClasses()]),this._pinIconColor()}_stateClasses(){return this._slot===`icon`?[y]:[]}_fill(e,t){let n=f(e,t);p(this._slot,n)&&this._detach();let r=this._slot===`icon`;if(this._slot=n,r!==(n===`icon`)&&this._restyle(),n===`empty`){this._detach();return}if(n===`child`){let e=t;if(this._content===e)return;this._detach(),this._adopt(e);let n=e;`hostButton`in n&&(n.hostButton=this);return}if(n===`label`){let e=this._content instanceof _?this._content:this._adopt(new _);e.className=b,e.text=m(this._label,!1,this._useUnderline);return}let i=this._content instanceof o?this._content:this._adopt(new o);i.iconName=this._iconName,this._pinIconColor()}_pinIconColor(){this._content instanceof o&&(this._styleClasses.some(e=>e===`osd`||e===`suggested-action`)||this._inOsdContainer())&&(this._content.iconColor=`#ffffff`)}_inOsdContainer(){for(let e=this.parent;e;e=e.parent)if((e.className??``).split(/\s+/).includes(`osd`))return!0;return!1}_detach(){this._content&&this.removeChild(this._content),this._content=null}_adopt(e){return e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,h.setColumn(e,0),h.setRow(e,0),this.addChild(e),this._content=e,e}};export{v as GTK_BUTTON_CLICKED,y as GTK_BUTTON_IMAGE_CLASS,b as GTK_BUTTON_LABEL_CLASS,GtkButton};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{GtkImage as r}from"./gtk-image.js";import{classNameWith as i}from"./style-classes.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{attachRowPressFeedback as o}from"./row-press.js";import{labelDisplayText as s}from"@gjsify/adwaita-core";import{GridLayout as c,ItemSpec as l,Label as u}from"@nativescript/core";import{objectSelectSymbolic as d}from"@gjsify/adwaita-icons/actions";const f=`toggled`,p=`activate`,m=`notify::active`,h=`checked`,g=`inconsistent`;var GtkCheckButton=class extends a{static GTypeName=`GtkCheckButton`;static emittedSignals=[f,p,m];static builderSlots=e([`child`],`child`);_indicator;_mark;_text;_active=!1;_inconsistent=!1;_label=null;_useUnderline=!1;_child=null;constructor(e){super(),this.addColumn(new l(1,`auto`)),this.addColumn(new l(1,`star`)),this.addRow(new l(1,`auto`));let t=new c;t.className=`adw-check-indicator`,t.addColumn(new l(1,`star`)),t.addRow(new l(1,`star`)),t.verticalAlignment=`middle`,c.setColumn(t,0),c.setRow(t,0);let i=new r;i.iconName=d,i.pixelSize=14,i.iconColor=`#ffffff`,i.horizontalAlignment=`center`,i.verticalAlignment=`middle`,i.visibility=`collapse`,t.addChild(i),this.addChild(t),this._indicator=t,this._mark=i;let a=new u;a.className=`adw-check-label`,a.verticalAlignment=`middle`,a.visibility=`collapse`,c.setColumn(a,1),c.setRow(a,0),this.addChild(a),this._text=a,o(this),this.addEventListener(`tap`,()=>{this._inconsistent=!1,this.active=!this._active,this._restyle(),this.notify({eventName:p,object:this})}),this._restyle(),n(this,e)}get active(){return this._active}set active(e){let n=t(e,this._active);n!==this._active&&(this._active=n,this._restyle(),this.notify({eventName:f,object:this}),this.notify({eventName:m,object:this}))}get inconsistent(){return this._inconsistent}set inconsistent(e){let n=t(e,this._inconsistent);n!==this._inconsistent&&(this._inconsistent=n,this._restyle(),this.notify({eventName:`notify::inconsistent`,object:this}))}get label(){return this._label}set label(e){this._label=e??null,this._paintLabel()}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=!!t(e,this._useUnderline),this._paintLabel()}_paintLabel(){this._text.text=s(this._label??``,!1,this._useUnderline),this._syncContent()}get child(){return this._child}set child(e){let t=e??null;t!==this._child&&(this._child&&this.removeChild(this._child),this._child=t,t&&(c.setColumn(t,1),c.setRow(t,0),this.addChild(t)),this._syncContent())}set_child(e){this.child=e}get_child(){return this._child}get_active(){return this._active}set_active(e){this.active=e}_addChildFromBuilder(e,t){this.child=t}_syncContent(){this._text.visibility=!this._child&&this._label?`visible`:`collapse`}get _ownClass(){return`adw-check-button`}_restyle(){let e=[];this._active&&e.push(h),this._inconsistent&&e.push(g),this.className=i(this._ownClass,[...this.styleClasses,...e]),this._indicator.className=i(`adw-check-indicator`,e),this._mark.visibility=this._active||this._inconsistent?`visible`:`collapse`}};export{p as GTK_CHECK_BUTTON_ACTIVATE,h as GTK_CHECK_BUTTON_CHECKED_CLASS,g as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,f as GTK_CHECK_BUTTON_TOGGLED,GtkCheckButton,m as NOTIFY_CHECK_ACTIVE};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n}from"./xml-values.js";import{GtkImage as r}from"./gtk-image.js";import{classNameWith as i}from"./style-classes.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{attachRowPressFeedback as o}from"./row-press.js";import{resolveIdReference as s}from"./id-reference.js";import{checkActivationFlips as c,checkGroupNeighbours as l,isRadioCheck as u,labelDisplayText as d,setCheckGroup as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m,Label as h}from"@nativescript/core";import{objectSelectSymbolic as g}from"@gjsify/adwaita-icons/actions";const _=`toggled`,v=`activate`,y=`notify::active`,b=`checked`,x=`inconsistent`;var S=class GtkCheckButton extends a{static GTypeName=`GtkCheckButton`;static emittedSignals=[_,v,y];static builderSlots=e([`child`],`child`);static builderReferences=[`group`];_indicator;_mark;_text;_active=!1;_inconsistent=!1;_label=null;_useUnderline=!1;_child=null;_groupId=null;constructor(e){super(),this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,`star`)),this.addRow(new m(1,`auto`));let n=new p;n.className=`adw-check-indicator`,n.addColumn(new m(1,`star`)),n.addRow(new m(1,`star`)),n.verticalAlignment=`middle`,p.setColumn(n,0),p.setRow(n,0);let i=new r;i.iconName=g,i.pixelSize=14,i.iconColor=`#ffffff`,i.horizontalAlignment=`center`,i.verticalAlignment=`middle`,i.visibility=`collapse`,n.addChild(i),this.addChild(n),this._indicator=n,this._mark=i;let a=new h;a.className=`adw-check-label`,a.verticalAlignment=`middle`,a.visibility=`collapse`,p.setColumn(a,1),p.setRow(a,0),this.addChild(a),this._text=a,this.addEventListener(`loaded`,()=>this._resolveGroupId()),o(this),this.addEventListener(`tap`,()=>{c(this,this._active)&&(this._inconsistent=!1,this.active=!this._active,this._restyle(),this.notify({eventName:v,object:this}))}),this._restyle(),t(this,e)}get active(){return this._active}set active(e){let t=n(e,this._active);if(t!==this._active){if(t)for(let e of l(this))e.active=!1;this._active=t,this._restyle(),this.notify({eventName:_,object:this}),this.notify({eventName:y,object:this})}}set group(e){if(typeof e==`string`){this._groupId=e,this.isLoaded&&this.set_group(s(this,`group`,e,GtkCheckButton));return}this._groupId=null,this.set_group(e)}set_group(e){f(this,e),this._restyle(),e?._restyle()}_resolveGroupId(){let e=this._groupId;e!==null&&(this._groupId=null,this.set_group(s(this,`group`,e,GtkCheckButton)))}get inconsistent(){return this._inconsistent}set inconsistent(e){let t=n(e,this._inconsistent);t!==this._inconsistent&&(this._inconsistent=t,this._restyle(),this.notify({eventName:`notify::inconsistent`,object:this}))}get label(){return this._label}set label(e){this._label=e??null,this._paintLabel()}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=!!n(e,this._useUnderline),this._paintLabel()}_paintLabel(){this._text.text=d(this._label??``,!1,this._useUnderline),this._syncContent()}get child(){return this._child}set child(e){let t=e??null;t!==this._child&&(this._child&&this.removeChild(this._child),this._child=t,t&&(p.setColumn(t,1),p.setRow(t,0),this.addChild(t)),this._syncContent())}set_child(e){this.child=e}get_child(){return this._child}get_active(){return this._active}set_active(e){this.active=e}_addChildFromBuilder(e,t){this.child=t}_syncContent(){this._text.visibility=!this._child&&this._label?`visible`:`collapse`}get _ownClass(){return`adw-check-button`}_restyle(){let e=[];this._active&&e.push(b),this._inconsistent&&e.push(x),this.className=i(this._ownClass,[...this.styleClasses,...e]),this._indicator.className=i(`adw-check-indicator`,u(this)?[...e,`radio`]:e),this._mark.visibility=this._active||this._inconsistent?`visible`:`collapse`}};export{v as GTK_CHECK_BUTTON_ACTIVATE,b as GTK_CHECK_BUTTON_CHECKED_CLASS,x as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,_ as GTK_CHECK_BUTTON_TOGGLED,S as GtkCheckButton,y as NOTIFY_CHECK_ACTIVE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{AdwStyledLayoutBase as n}from"./styled-layout-base.js";const r=`Gtk.DrawingArea.set_draw_func is not supported on NativeScript: there is no cairo context to draw into. Render through a NativeScript view (an Image, or @nativescript/canvas) instead.`;var GtkDrawingArea=class extends n{static GTypeName=`GtkDrawingArea`;_contentWidth=0;_contentHeight=0;constructor(e){super(),t(this,e)}get contentWidth(){return this._contentWidth}set contentWidth(t){let n=Math.max(0,Math.trunc(e(t,this._contentWidth)));this._contentWidth=n,this.minWidth=n}get contentHeight(){return this._contentHeight}set contentHeight(t){let n=Math.max(0,Math.trunc(e(t,this._contentHeight)));this._contentHeight=n,this.minHeight=n}set_draw_func(e){throw Error(r)}queue_draw(){}};export{r as DRAWING_AREA_REFUSAL,GtkDrawingArea};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{AdwStyledLayoutBase as n}from"./styled-layout-base.js";const r=`Gtk.DrawingArea.set_draw_func is not supported on NativeScript: there is no cairo context to draw into. Render through a NativeScript view (an Image, or @nativescript/canvas) instead.`;var GtkDrawingArea=class extends n{static GTypeName=`GtkDrawingArea`;_contentWidth=0;_contentHeight=0;constructor(t){super(),e(this,t)}get contentWidth(){return this._contentWidth}set contentWidth(e){let n=Math.max(0,Math.trunc(t(e,this._contentWidth)));this._contentWidth=n,this.minWidth=n}get contentHeight(){return this._contentHeight}set contentHeight(e){let n=Math.max(0,Math.trunc(t(e,this._contentHeight)));this._contentHeight=n,this.minHeight=n}set_draw_func(e){throw Error(r)}queue_draw(){}};export{r as DRAWING_AREA_REFUSAL,GtkDrawingArea};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{withSignals as i}from"./signals.js";import{GtkImage as a}from"./gtk-image.js";import{attachRowPressFeedback as o}from"./row-press.js";import{ComboState as s,normalizeComboOptions as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u,action as d}from"@nativescript/core";import{panDownSymbolic as f}from"@gjsify/adwaita-icons/ui";const p=`notify::selected`,m=`notify::selected-item`;var GtkDropDown=class extends i(u){static GTypeName=`GtkDropDown`;static emittedSignals=[p,m];static builderSlots=e([`model`],`model`);_label;_chevron;_state=new s;_chooserTitle=``;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let t=new l;t.className=`adw-drop-down-label`,t.text=``;let n=new a;n.className=`adw-drop-down-chevron`,n.iconName=f,this.addChild(t),this.addChild(n),this._label=t,this._chevron=n,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive)for(let t of[p,m]){let n={eventName:t,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(n)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),o(this),r(this,e)}async _openChooser(){if(this._state.count===0)return;let e=this._state.model.map(e=>e.label),t=await d({title:this._chooserTitle||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get model(){return this._state.model}set model(e){this._state.setModel(c(e))}_addChildFromBuilder(e,n){if(t(e,[`model`],`child`)!==`model`)throw Error(`Gtk.DropDown takes no child widget; <${e}> is placed nowhere.`);this.model=n}get selected(){return this._state.selectedIndex}set selected(e){let t=n(e,this.selected);this._state.setSelectedIndex(t)}get_selected(){return this.selected}set_selected(e){this.selected=e}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.model[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{GtkDropDown,p as NOTIFY_SELECTED,m as NOTIFY_SELECTED_ITEM};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlNumber as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{GtkImage as a}from"./gtk-image.js";import{attachRowPressFeedback as o}from"./row-press.js";import{ComboState as s,normalizeComboOptions as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u,action as d}from"@nativescript/core";import{panDownSymbolic as f}from"@gjsify/adwaita-icons/ui";const p=`notify::selected`,m=`notify::selected-item`;var GtkDropDown=class extends i(u){static GTypeName=`GtkDropDown`;static emittedSignals=[p,m];static builderSlots=e([`model`],`model`);_label;_chevron;_state=new s;_chooserTitle=``;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let t=new l;t.className=`adw-drop-down-label`,t.text=``;let r=new a;r.className=`adw-drop-down-chevron`,r.iconName=f,this.addChild(t),this.addChild(r),this._label=t,this._chevron=r,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive)for(let t of[p,m]){let n={eventName:t,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(n)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),o(this),n(this,e)}async _openChooser(){if(this._state.count===0)return;let e=this._state.model.map(e=>e.label),t=await d({title:this._chooserTitle||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get model(){return this._state.model}set model(e){this._state.setModel(c(e))}_addChildFromBuilder(e,n){if(t(e,[`model`],`child`)!==`model`)throw Error(`Gtk.DropDown takes no child widget; <${e}> is placed nowhere.`);this.model=n}get selected(){return this._state.selectedIndex}set selected(e){let t=r(e,this.selected);this._state.setSelectedIndex(t)}get_selected(){return this.selected}set_selected(e){this.selected=e}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.model[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{GtkDropDown,p as NOTIFY_SELECTED,m as NOTIFY_SELECTED_ITEM};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{ENTRY_ROW_MAX_LENGTH_LIMIT as i,clampEntryText as a,entryTextLength as o}from"@gjsify/adwaita-core";import{GridLayout as s,ItemSpec as c,TextField as l}from"@nativescript/core";const u=`notify::text`,d=`activate`,f=`changed`;var GtkEntry=class extends r(s){static GTypeName=`GtkEntry`;static emittedSignals=[f,u,d];_field;_text=``;_maxLength=0;constructor(e){super(),this.className=`adw-entry`,this.addColumn(new c(1,`star`)),this.addRow(new c(1,`auto`));let t=new l;t.className=`adw-entry-input`,t.set(`backgroundColor`,`transparent`),t.set(`borderWidth`,0),this.addChild(t),this._field=t,t.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),t.addEventListener(`returnPress`,()=>{let e={eventName:d,object:this};this.notify(e)}),n(this,e)}_applyText(e){let t=a(e,this._maxLength);if(this._field.text!==t&&(this._field.text=t),t===this._text)return;this._text=t;let n={eventName:u,object:this,text:t,textLength:o(t)};this.notify({eventName:f,object:this}),this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return o(this._text)}get maxLength(){return this._maxLength}set maxLength(e){let n=t(e,this.maxLength);this._maxLength=Number.isFinite(n)?Math.min(i,Math.max(0,Math.trunc(n))):0,this._applyText(this._text)}get placeholderText(){return this._field.hint??``}set placeholderText(e){this._field.hint=e??``}get editable(){return this._field.editable}set editable(t){let n=e(t,this.editable);this._field.editable=!!n}get field(){return this._field}};export{d as ACTIVATE,f as CHANGED,GtkEntry,u as NOTIFY_TEXT};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{ENTRY_ROW_MAX_LENGTH_LIMIT as i,clampEntryText as a,entryTextLength as o}from"@gjsify/adwaita-core";import{GridLayout as s,ItemSpec as c,TextField as l}from"@nativescript/core";const u=`notify::text`,d=`activate`,f=`changed`;var GtkEntry=class extends r(s){static GTypeName=`GtkEntry`;static emittedSignals=[f,u,d];_field;_text=``;_maxLength=0;constructor(t){super(),this.className=`adw-entry`,this.addColumn(new c(1,`star`)),this.addRow(new c(1,`auto`));let n=new l;n.className=`adw-entry-input`,n.set(`backgroundColor`,`transparent`),n.set(`borderWidth`,0),this.addChild(n),this._field=n,n.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),n.addEventListener(`returnPress`,()=>{let e={eventName:d,object:this};this.notify(e)}),e(this,t)}_applyText(e){let t=a(e,this._maxLength);if(this._field.text!==t&&(this._field.text=t),t===this._text)return;this._text=t;let n={eventName:u,object:this,text:t,textLength:o(t)};this.notify({eventName:f,object:this}),this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return o(this._text)}get maxLength(){return this._maxLength}set maxLength(e){let t=n(e,this.maxLength);this._maxLength=Number.isFinite(t)?Math.min(i,Math.max(0,Math.trunc(t))):0,this._applyText(this._text)}get placeholderText(){return this._field.hint??``}set placeholderText(e){this._field.hint=e??``}get editable(){return this._field.editable}set editable(e){let n=t(e,this.editable);this._field.editable=!!n}get field(){return this._field}};export{d as ACTIVATE,f as CHANGED,GtkEntry,u as NOTIFY_TEXT};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{lengthValue as r}from"./ns-length.js";import{AdwStyledLayoutBase as i}from"./styled-layout-base.js";import{gridChildAt as a,gridGap as o,gridSpacing as s,gridTrackCounts as c}from"./grid-state.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";const d=[`colChange`,`rowChange`,`colSpanChange`,`rowSpanChange`];var GtkGrid=class extends i{static GTypeName=`GtkGrid`;_rowSpacing=0;_columnSpacing=0;_rowHomogeneous=!1;_columnHomogeneous=!1;_columnKey=``;_rowKey=``;_gaps=new Map;_followers=new Map;constructor(e){super(),n(this,e)}attach(e,t,n,r=1,i=1){e.column=t,e.row=n,e.columnSpan=r,e.rowSpan=i,this.addChild(e)}remove(e){this.removeChild(e)}get_child_at(e,t){return a(this._placed(),e,t)}addChild(e){super.addChild(e),this._follow(e),this._relayout()}insertChild(e,t){let n=super.insertChild(e,t);return this._follow(e),this._relayout(),n}removeChild(e){this._unfollow(e),super.removeChild(e),this._relayout()}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){let n=s(t(e,NaN),e,this._rowSpacing,`rowSpacing`);n!==this._rowSpacing&&(this._rowSpacing=n,this._relayout())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){let n=s(t(e,NaN),e,this._columnSpacing,`columnSpacing`);n!==this._columnSpacing&&(this._columnSpacing=n,this._relayout())}get rowHomogeneous(){return this._rowHomogeneous}set rowHomogeneous(t){let n=e(t,this._rowHomogeneous);n!==this._rowHomogeneous&&(this._rowHomogeneous=n,this._relayout())}get columnHomogeneous(){return this._columnHomogeneous}set columnHomogeneous(t){let n=e(t,this._columnHomogeneous);n!==this._columnHomogeneous&&(this._columnHomogeneous=n,this._relayout())}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_placementOf(e){return{column:l.getColumn(e),row:l.getRow(e),columnSpan:l.getColumnSpan(e),rowSpan:l.getRowSpan(e)}}_placed(){return this._childViews().map(e=>({child:e,placement:this._placementOf(e)}))}_follow(e){if(this._followers.has(e))return;let follower=()=>this._relayout();this._followers.set(e,follower);for(let t of d)e.addEventListener(t,follower)}_unfollow(e){let t=this._followers.get(e);if(t!==void 0){for(let n of d)e.removeEventListener(n,t);this._followers.delete(e),this._withGap(e,{left:0,top:0}),this._gaps.delete(e)}}_withGap(e,t){let n=this._gaps.get(e)??{left:0,top:0};n.left!==t.left&&(e.marginLeft=(r(e.marginLeft)??0)-n.left+t.left),n.top!==t.top&&(e.marginTop=(r(e.marginTop)??0)-n.top+t.top),this._gaps.set(e,t)}_relayout(){let e=this._placed(),{columns:t,rows:n}=c(e.map(({placement:e})=>e));this._syncTracks(t,n);for(let{child:t,placement:n}of e)this._withGap(t,o(n,this._columnSpacing,this._rowSpacing))}_syncTracks(e,t){let n=`${e}:${this._columnHomogeneous}`,r=`${t}:${this._rowHomogeneous}`;if(n!==this._columnKey){this.removeColumns();for(let t=0;t<e;t++)this.addColumn(new u(1,this._columnHomogeneous?`star`:`auto`));this._columnKey=n}if(r!==this._rowKey){this.removeRows();for(let e=0;e<t;e++)this.addRow(new u(1,this._rowHomogeneous?`star`:`auto`));this._rowKey=r}}};export{GtkGrid};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{lengthValue as t}from"./ns-length.js";import{xmlBoolean as n,xmlNumber as r}from"./xml-values.js";import{AdwStyledLayoutBase as i}from"./styled-layout-base.js";import{gridChildAt as a,gridGap as o,gridSpacing as s,gridTrackCounts as c}from"./grid-state.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";const d=[`colChange`,`rowChange`,`colSpanChange`,`rowSpanChange`];var GtkGrid=class extends i{static GTypeName=`GtkGrid`;_rowSpacing=0;_columnSpacing=0;_rowHomogeneous=!1;_columnHomogeneous=!1;_columnKey=``;_rowKey=``;_gaps=new Map;_followers=new Map;constructor(t){super(),e(this,t)}attach(e,t,n,r=1,i=1){e.column=t,e.row=n,e.columnSpan=r,e.rowSpan=i,this.addChild(e)}remove(e){this.removeChild(e)}get_child_at(e,t){return a(this._placed(),e,t)}addChild(e){super.addChild(e),this._follow(e),this._relayout()}insertChild(e,t){let n=super.insertChild(e,t);return this._follow(e),this._relayout(),n}removeChild(e){this._unfollow(e),super.removeChild(e),this._relayout()}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){let t=s(r(e,NaN),e,this._rowSpacing,`rowSpacing`);t!==this._rowSpacing&&(this._rowSpacing=t,this._relayout())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){let t=s(r(e,NaN),e,this._columnSpacing,`columnSpacing`);t!==this._columnSpacing&&(this._columnSpacing=t,this._relayout())}get rowHomogeneous(){return this._rowHomogeneous}set rowHomogeneous(e){let t=n(e,this._rowHomogeneous);t!==this._rowHomogeneous&&(this._rowHomogeneous=t,this._relayout())}get columnHomogeneous(){return this._columnHomogeneous}set columnHomogeneous(e){let t=n(e,this._columnHomogeneous);t!==this._columnHomogeneous&&(this._columnHomogeneous=t,this._relayout())}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_placementOf(e){return{column:l.getColumn(e),row:l.getRow(e),columnSpan:l.getColumnSpan(e),rowSpan:l.getRowSpan(e)}}_placed(){return this._childViews().map(e=>({child:e,placement:this._placementOf(e)}))}_follow(e){if(this._followers.has(e))return;let follower=()=>this._relayout();this._followers.set(e,follower);for(let t of d)e.addEventListener(t,follower)}_unfollow(e){let t=this._followers.get(e);if(t!==void 0){for(let n of d)e.removeEventListener(n,t);this._followers.delete(e),this._withGap(e,{left:0,top:0}),this._gaps.delete(e)}}_withGap(e,n){let r=this._gaps.get(e)??{left:0,top:0};r.left!==n.left&&(e.marginLeft=(t(e.marginLeft)??0)-r.left+n.left),r.top!==n.top&&(e.marginTop=(t(e.marginTop)??0)-r.top+n.top),this._gaps.set(e,n)}_relayout(){let e=this._placed(),{columns:t,rows:n}=c(e.map(({placement:e})=>e));this._syncTracks(t,n);for(let{child:t,placement:n}of e)this._withGap(t,o(n,this._columnSpacing,this._rowSpacing))}_syncTracks(e,t){let n=`${e}:${this._columnHomogeneous}`,r=`${t}:${this._rowHomogeneous}`;if(n!==this._columnKey){this.removeColumns();for(let t=0;t<e;t++)this.addColumn(new u(1,this._columnHomogeneous?`star`:`auto`));this._columnKey=n}if(r!==this._rowKey){this.removeRows();for(let e=0;e<t;e++)this.addRow(new u(1,this._rowHomogeneous?`star`:`auto`));this._rowKey=r}}};export{GtkGrid};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{DEFAULT_ICON_PIXEL_SIZE as t,gtkIconSizeNick as n,iconPixelSize as r,storedPixelSize as i}from"./gtk-icon-size.js";import{applyConstructProps as a}from"./construct-props.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{resolveIconSource as u}from"./icon-theme.js";import{renderSymbolicIcon as d}from"./icons.js";import{Image as f}from"@nativescript/core";const p=t;var GtkImage=class extends o(f){static GTypeName=`GtkImage`;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;constructor(e){super(),this.className=`adw-icon`,this.stretch=`aspectFit`,this._applySize(),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null}),a(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return r(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this.width=e,this.height=e,this._render()}_render(){let e=u(this._icon);if(!e)return;let t=d(e,{size:this._renderedSize,color:this._iconColor});t&&(this.imageSource=t)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._render()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=n(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(t){this._pixelSize=i(e(t,this._pixelSize)),this._applySize()}};export{p as DEFAULT_GTK_IMAGE_SIZE,GtkImage};
1
+ import"../_virtual/_rolldown/runtime.js";import{DEFAULT_ICON_PIXEL_SIZE as e,gtkIconSizeNick as t,iconPixelSize as n,storedPixelSize as r}from"./gtk-icon-size.js";import{applyConstructProps as i}from"./construct-props.js";import{xmlNumber as a}from"./xml-values.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{Image as f}from"@nativescript/core";const p=e;var GtkImage=class extends o(f){static GTypeName=`GtkImage`;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;_unsubIcons=null;constructor(e){super(),this.className=`adw-icon`,this.stretch=`aspectFit`,this._applySize(),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor()),this._unsubIcons??=d(()=>this._render())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null,this._unsubIcons?.(),this._unsubIcons=null}),i(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return n(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this.width=e,this.height=e,this._render()}_render(){u(this,this._icon,this._renderedSize,this._iconColor)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._render()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=t(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(e){this._pixelSize=r(a(e,this._pixelSize)),this._applySize()}};export{p as DEFAULT_GTK_IMAGE_SIZE,GtkImage};
@@ -1,2 +1,2 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{androidApiLevel as r}from"./native-tooltip.js";import{withSignals as i}from"./signals.js";import{classNameWith as a,normalizeStyleClasses as o,withCssClass as s,withoutCssClass as c}from"./style-classes.js";import{DEFAULT_LABEL_LINES as l,DEFAULT_LABEL_XALIGN as u,LABEL_JUSTIFICATIONS as d,labelDisplayText as f,labelEffectiveLines as p,labelEllipsizeOverflowValue as m,normalizeLabelEllipsize as h,normalizeLabelLines as g,normalizeLabelXalign as _}from"@gjsify/adwaita-core";import{Label as v}from"@nativescript/core";const y=new Map([[0,`start`],[.5,`center`],[1,`end`]]),b={left:`start`,right:`end`,center:`center`,fill:`start`};function physical(e,t){return e===`center`?`center`:e===`start`===t?`right`:`left`}var GtkLabel=class extends i(v){static GTypeName=`GtkLabel`;_label=``;_useMarkup=!1;_useUnderline=!1;_ellipsize=`none`;_lines=-1;_styleClasses=[];_xalign=u;_xalignWritten=!1;_justify=`left`;_selectable=!1;constructor(e){super(),this.addEventListener(`loaded`,()=>{this._applySelectable(),this._applyJustificationMode()}),n(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._render()}get useMarkup(){return this._useMarkup}set useMarkup(t){this._useMarkup=e(t,this._useMarkup),this._render()}get useUnderline(){return this._useUnderline}set useUnderline(t){this._useUnderline=e(t,this._useUnderline),this._render()}get wrap(){return this.textWrap}set wrap(t){let n=e(t,this.textWrap);this._applyAlignment({wrap:n}),this.textWrap=n}get ellipsize(){return this._ellipsize}set ellipsize(e){this._ellipsize=h(e),this.textOverflow=m(this._ellipsize),this._applyLines()}get lines(){return this._lines}set lines(e){this._lines=g(t(e,l)),this._applyLines()}get selectable(){return this._selectable}set selectable(t){this._selectable=e(t,this._selectable),this._applySelectable()}_applySelectable(){this.nativeViewProtected?.setTextIsSelectable?.(this._selectable)}_applyLines(){this.maxLines=p(this._lines,this._ellipsize)??0}get justify(){return this._justify}set justify(e){let n=d.includes(e)?e:d[t(e,-1)];if(n===void 0)throw TypeError(`'${String(e)}' is not a Gtk.Justification, so it cannot be 'justify'. The members are ${d.join(`, `)}, or their values 0 to 3.`);this._applyAlignment({justify:n})}get xalign(){return this._xalign}set xalign(e){let n=_(t(e,u));if(!y.has(n))throw TypeError(`Gtk.Label xalign ${n} has no NativeScript counterpart: textAlignment places text at the start, the centre or the end, so only 0, 0.5 and 1 render as written. Snapping it would show a different label than GTK does with no sign of the difference.`);this._applyAlignment({xalign:n})}_applyAlignment(e){let t=e.xalign??(this._xalignWritten?this._xalign:null),n=e.justify??this._justify,r=e.text??this.text??``,i=(e.wrap??this.textWrap)||r.includes(`
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{androidApiLevel as r}from"./native-tooltip.js";import{withSignals as i}from"./signals.js";import{classNameWith as a,normalizeStyleClasses as o,withCssClass as s,withoutCssClass as c}from"./style-classes.js";import{DEFAULT_LABEL_LINES as l,DEFAULT_LABEL_XALIGN as u,LABEL_JUSTIFICATIONS as d,labelDisplayText as f,labelEffectiveLines as p,labelEllipsizeOverflowValue as m,normalizeLabelEllipsize as h,normalizeLabelLines as g,normalizeLabelXalign as _}from"@gjsify/adwaita-core";import{Label as v}from"@nativescript/core";const y=new Map([[0,`start`],[.5,`center`],[1,`end`]]),b={left:`start`,right:`end`,center:`center`,fill:`start`};function physical(e,t){return e===`center`?`center`:e===`start`===t?`right`:`left`}var GtkLabel=class extends i(v){static GTypeName=`GtkLabel`;_label=``;_useMarkup=!1;_useUnderline=!1;_ellipsize=`none`;_lines=-1;_styleClasses=[];_xalign=u;_xalignWritten=!1;_justify=`left`;_selectable=!1;constructor(t){super(),this.addEventListener(`loaded`,()=>{this._applySelectable(),this._applyJustificationMode()}),e(this,t)}get label(){return this._label}set label(e){this._label=e??``,this._render()}get useMarkup(){return this._useMarkup}set useMarkup(e){this._useMarkup=t(e,this._useMarkup),this._render()}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=t(e,this._useUnderline),this._render()}get wrap(){return this.textWrap}set wrap(e){let n=t(e,this.textWrap);this._applyAlignment({wrap:n}),this.textWrap=n}get ellipsize(){return this._ellipsize}set ellipsize(e){this._ellipsize=h(e),this.textOverflow=m(this._ellipsize),this._applyLines()}get lines(){return this._lines}set lines(e){this._lines=g(n(e,l)),this._applyLines()}get selectable(){return this._selectable}set selectable(e){this._selectable=t(e,this._selectable),this._applySelectable()}_applySelectable(){this.nativeViewProtected?.setTextIsSelectable?.(this._selectable)}_applyLines(){this.maxLines=p(this._lines,this._ellipsize)??0}get justify(){return this._justify}set justify(e){let t=d.includes(e)?e:d[n(e,-1)];if(t===void 0)throw TypeError(`'${String(e)}' is not a Gtk.Justification, so it cannot be 'justify'. The members are ${d.join(`, `)}, or their values 0 to 3.`);this._applyAlignment({justify:t})}get xalign(){return this._xalign}set xalign(e){let t=_(n(e,u));if(!y.has(t))throw TypeError(`Gtk.Label xalign ${t} has no NativeScript counterpart: textAlignment places text at the start, the centre or the end, so only 0, 0.5 and 1 render as written. Snapping it would show a different label than GTK does with no sign of the difference.`);this._applyAlignment({xalign:t})}_applyAlignment(e){let t=e.xalign??(this._xalignWritten?this._xalign:null),n=e.justify??this._justify,r=e.text??this.text??``,i=(e.wrap??this.textWrap)||r.includes(`
2
2
  `),a=b[n],o=t===null?null:y.get(t),s;if(o===null)s=n===`left`?null:a;else if(o===a||!i||n===`left`)s=o;else throw TypeError(`Gtk.Label justify ${n} beside xalign ${t} has no NativeScript counterpart on a label that can show several lines: GTK places the text block at its ${o} and aligns the lines inside it to their ${a}, and textAlignment is one alignment for both. An xalign on the justify edge, or a label without wrap and newline, renders exactly.`);if(e.xalign!==void 0&&(this._xalign=e.xalign,this._xalignWritten=!0),e.justify!==void 0&&(this._justify=e.justify),s===null){(e.xalign!==void 0||e.justify!==void 0)&&(this.textAlignment=`initial`);return}let c=physical(s,this.style?.direction===`rtl`);this.textAlignment=n===`fill`&&c===`left`?`justify`:c,this._applyJustificationMode()}_applyJustificationMode(){this.textAlignment===`justify`||r()<26||this.nativeViewProtected?.setJustificationMode?.(+(this._justify===`fill`))}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(o(e))}get_label(){return this.label}set_label(e){this.label=e}set_markup(e){this._label=e??``,this._useMarkup=!0,this._render()}get_text(){return this.text??``}add_css_class(e){this._setClasses(s(this._styleClasses,e))}remove_css_class(e){this._setClasses(c(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(o([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this.className=a(``,this._styleClasses)}_render(){let e=f(this._label,this._useMarkup,this._useUnderline);this._applyAlignment({text:e}),this.text=e}};export{GtkLabel};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{ACTIVATED as n}from"./adw-action-row.js";import{AdwStyledLayoutBase as r}from"./styled-layout-base.js";import{addMarkerClass as i,removeMarkerClass as a}from"./bottom-sheet-state.js";import{DEFAULT_LIST_SELECTION_MODE as o,selectionAfterModeChange as s,selectionAfterTap as c,selectionMode as l}from"./list-box-state.js";import{GridLayout as u,ItemSpec as d}from"@nativescript/core";const f=`row-activated`,p=`row-selected`,m=`adw-list-row-selected`,h=`adw-row-flush-top`;function markRow(e,t,n){let r=n?i(e.className,t):a(e.className,t);r!==(e.className??``)&&(e.className=r)}var GtkListBox=class extends r{static GTypeName=`GtkListBox`;_selectionMode=o;_activateOnSingleClick=!0;_showSeparators=!1;_acceptUnpairedRelease=!1;_selected=[];_listeners=new Map;constructor(e){super(),this.addColumn(new d(1,`star`)),t(this,e)}append(e){this.addChild(e)}prepend(e){this.insert(e,0)}insert(e,t){let n=this.getChildrenCount();if(t<0||t>=n){this.addChild(e);return}this.insertChild(e,t)}remove(e){this.removeChild(e)}remove_all(){for(let e of this._rowViews())this.removeChild(e)}get_row_at_index(e){return this._rowViews()[e]??null}addChild(e){super.addChild(e),this._adopt(e)}insertChild(e,t){let n=super.insertChild(e,t);return this._adopt(e),n}removeChild(e){this._release(e),super.removeChild(e),this._renumber()}_addChildFromBuilder(e,t){this.append(t)}get_selected_row(){return this._selected[0]??null}get_selected_rows(){return this._rowViews().filter(e=>this._selected.includes(e))}select_row(e){if(e===null){this.unselect_all();return}this._selectionMode===`none`||!this._rowViews().includes(e)||this._setSelected(this._selectionMode===`multiple`?[...this._selected,e]:[e])}unselect_row(e){this._setSelected(this._selected.filter(t=>t!==e))}select_all(){this._selectionMode===`multiple`&&this._setSelected(this._rowViews())}unselect_all(){this._setSelected([])}get selectionMode(){return this._selectionMode}set selectionMode(e){this._selectionMode=l(e),this._setSelected(s(this._selectionMode,this._selected))}get activateOnSingleClick(){return this._activateOnSingleClick}set activateOnSingleClick(t){this._activateOnSingleClick=e(t,this._activateOnSingleClick)}get showSeparators(){return this._showSeparators}set showSeparators(t){this._showSeparators=e(t,this._showSeparators)}get acceptUnpairedRelease(){return this._acceptUnpairedRelease}set acceptUnpairedRelease(t){this._acceptUnpairedRelease=e(t,this._acceptUnpairedRelease)}_rowViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_renumber(){let e=this._rowViews();this.removeRows();for(let[t,n]of e.entries())this.addRow(new d(1,`auto`)),u.setColumn(n,0),u.setRow(n,t),markRow(n,h,t===0)}_adopt(e){if(this._renumber(),this._listeners.has(e))return;let t={tap:()=>{this._tapped(e),`activatable`in e||this._activated(e)},activated:()=>this._activated(e)};this._listeners.set(e,t),e.addEventListener(`tap`,t.tap),e.addEventListener(n,t.activated)}_release(e){let t=this._listeners.get(e);t!==void 0&&(e.removeEventListener(`tap`,t.tap),e.removeEventListener(n,t.activated),this._listeners.delete(e)),markRow(e,h,!1),markRow(e,m,!1),this._selected.includes(e)&&this._setSelected(this._selected.filter(t=>t!==e))}_tapped(e){this._setSelected(c(this._selectionMode,this._selected,e))}_activated(e){let t={eventName:f,object:this,row:e};this.notify(t)}_setSelected(e){let t=this._selected;if(t.length===e.length&&t.every((t,n)=>t===e[n]))return;for(let n of t)e.includes(n)||markRow(n,m,!1);for(let t of e)markRow(t,m,!0);this._selected=[...e];let n={eventName:p,object:this,row:this._selected[0]??null};this.notify(n)}};export{GtkListBox,f as LIST_BOX_ROW_ACTIVATED,p as LIST_BOX_ROW_SELECTED,m as LIST_ROW_SELECTED_CLASS};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{ACTIVATED as n}from"./adw-action-row.js";import{AdwStyledLayoutBase as r}from"./styled-layout-base.js";import{addMarkerClass as i,removeMarkerClass as a}from"./bottom-sheet-state.js";import{DEFAULT_LIST_SELECTION_MODE as o,selectionAfterModeChange as s,selectionAfterTap as c,selectionMode as l}from"./list-box-state.js";import{GridLayout as u,ItemSpec as d}from"@nativescript/core";const f=`row-activated`,p=`row-selected`,m=`adw-list-row-selected`,h=`adw-row-flush-top`;function markRow(e,t,n){let r=n?i(e.className,t):a(e.className,t);r!==(e.className??``)&&(e.className=r)}var GtkListBox=class extends r{static GTypeName=`GtkListBox`;_selectionMode=o;_activateOnSingleClick=!0;_showSeparators=!1;_acceptUnpairedRelease=!1;_selected=[];_listeners=new Map;constructor(t){super(),this.addColumn(new d(1,`star`)),e(this,t)}append(e){this.addChild(e)}prepend(e){this.insert(e,0)}insert(e,t){let n=this.getChildrenCount();if(t<0||t>=n){this.addChild(e);return}this.insertChild(e,t)}remove(e){this.removeChild(e)}remove_all(){for(let e of this._rowViews())this.removeChild(e)}get_row_at_index(e){return this._rowViews()[e]??null}addChild(e){super.addChild(e),this._adopt(e)}insertChild(e,t){let n=super.insertChild(e,t);return this._adopt(e),n}removeChild(e){this._release(e),super.removeChild(e),this._renumber()}_addChildFromBuilder(e,t){this.append(t)}get_selected_row(){return this._selected[0]??null}get_selected_rows(){return this._rowViews().filter(e=>this._selected.includes(e))}select_row(e){if(e===null){this.unselect_all();return}this._selectionMode===`none`||!this._rowViews().includes(e)||this._setSelected(this._selectionMode===`multiple`?[...this._selected,e]:[e])}unselect_row(e){this._setSelected(this._selected.filter(t=>t!==e))}select_all(){this._selectionMode===`multiple`&&this._setSelected(this._rowViews())}unselect_all(){this._setSelected([])}get selectionMode(){return this._selectionMode}set selectionMode(e){this._selectionMode=l(e),this._setSelected(s(this._selectionMode,this._selected))}get activateOnSingleClick(){return this._activateOnSingleClick}set activateOnSingleClick(e){this._activateOnSingleClick=t(e,this._activateOnSingleClick)}get showSeparators(){return this._showSeparators}set showSeparators(e){this._showSeparators=t(e,this._showSeparators)}get acceptUnpairedRelease(){return this._acceptUnpairedRelease}set acceptUnpairedRelease(e){this._acceptUnpairedRelease=t(e,this._acceptUnpairedRelease)}_rowViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_renumber(){let e=this._rowViews();this.removeRows();for(let[t,n]of e.entries())this.addRow(new d(1,`auto`)),u.setColumn(n,0),u.setRow(n,t),markRow(n,h,t===0)}_adopt(e){if(this._renumber(),this._listeners.has(e))return;let t={tap:()=>{this._tapped(e),`activatable`in e||this._activated(e)},activated:()=>this._activated(e)};this._listeners.set(e,t),e.addEventListener(`tap`,t.tap),e.addEventListener(n,t.activated)}_release(e){let t=this._listeners.get(e);t!==void 0&&(e.removeEventListener(`tap`,t.tap),e.removeEventListener(n,t.activated),this._listeners.delete(e)),markRow(e,h,!1),markRow(e,m,!1),this._selected.includes(e)&&this._setSelected(this._selected.filter(t=>t!==e))}_tapped(e){this._setSelected(c(this._selectionMode,this._selected,e))}_activated(e){let t={eventName:f,object:this,row:e};this.notify(t)}_setSelected(e){let t=this._selected;if(t.length===e.length&&t.every((t,n)=>t===e[n]))return;for(let n of t)e.includes(n)||markRow(n,m,!1);for(let t of e)markRow(t,m,!0);this._selected=[...e];let n={eventName:p,object:this,row:this._selected[0]??null};this.notify(n)}};export{GtkListBox,f as LIST_BOX_ROW_ACTIVATED,p as LIST_BOX_ROW_SELECTED,m as LIST_ROW_SELECTED_CLASS};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{classNameWith as n,normalizeStyleClasses as r,withCssClass as i,withoutCssClass as a}from"./style-classes.js";import{AdwImageButton as o}from"./adw-image-button.js";import{assertPopupMenuAssignable as s,refuseMenuString as c}from"./popup-menu.js";import{showMenuPopup as l}from"./popup-menu-view.js";import{normalizeMenuModel as u}from"@gjsify/adwaita-core";const d=`menuItemActivated`;var GtkMenuButton=class extends o{static GTypeName=`GtkMenuButton`;_model=[];_actions=null;_menuTitle=``;_primary=!1;_baseClassName;_styleClasses=[];constructor(e){super(),this._baseClassName=`${this.className} adw-menu-button`.trim(),this.className=this._baseClassName,this.addEventListener(`tap`,()=>this._openMenu()),t(this,e)}get menuModel(){return this._model}set menuModel(e){c(e,`GtkMenuButton`);let t=u(e);s(t),this._model=t}get actions(){return this._actions}set actions(e){this._actions=e??null}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(r(e))}get primary(){return this._primary}set primary(t){this._primary=e(t,this._primary)}add_css_class(e){this._setClasses(i(this._styleClasses,e))}remove_css_class(e){this._setClasses(a(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(r([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=n(this._baseClassName,e)}_openMenu(){this._model.length!==0&&l(this,{model:this._model,actions:this._actions,onActivated:(e,t)=>{let n={eventName:d,object:this,id:e.id??e.label,label:e.label,path:t,action:e.action};this.notify(n)}})}};export{GtkMenuButton,d as MENU_ITEM_ACTIVATED};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{classNameWith as n,normalizeStyleClasses as r,withCssClass as i,withoutCssClass as a}from"./style-classes.js";import{AdwImageButton as o}from"./adw-image-button.js";import{assertPopupMenuAssignable as s,refuseMenuString as c}from"./popup-menu.js";import{showMenuPopup as l}from"./popup-menu-view.js";import{normalizeMenuModel as u}from"@gjsify/adwaita-core";const d=`menuItemActivated`;var GtkMenuButton=class extends o{static GTypeName=`GtkMenuButton`;_model=[];_actions=null;_menuTitle=``;_primary=!1;_baseClassName;_styleClasses=[];constructor(t){super(),this._baseClassName=`${this.className} adw-menu-button`.trim(),this.className=this._baseClassName,this.addEventListener(`tap`,()=>this._openMenu()),e(this,t)}get menuModel(){return this._model}set menuModel(e){c(e,`GtkMenuButton`);let t=u(e);s(t),this._model=t}get actions(){return this._actions}set actions(e){this._actions=e??null}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(r(e))}get primary(){return this._primary}set primary(e){this._primary=t(e,this._primary)}add_css_class(e){this._setClasses(i(this._styleClasses,e))}remove_css_class(e){this._setClasses(a(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(r([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=n(this._baseClassName,e)}_openMenu(){this._model.length!==0&&l(this,{model:this._model,actions:this._actions,onActivated:(e,t)=>{let n={eventName:d,object:this,id:e.id??e.label,label:e.label,path:t,action:e.action};this.notify(n)}})}};export{GtkMenuButton,d as MENU_ITEM_ACTIVATED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{GTK_REVEALER_TRANSITIONS as i,transitionNick as a}from"./transition-type.js";import{AdwSingleChildBase as o}from"./single-child-base.js";import{revealerChildVisibility as s}from"./revealer-state.js";const c=`notify::reveal-child`;var GtkRevealer=class extends o{static GTypeName=`GtkRevealer`;static builderSlots=e([`child`],`child`);_revealChild=!1;_transitionType=`slide-down`;_transitionDuration=250;constructor(e){super(),r(this,e)}get revealChild(){return this._revealChild}set revealChild(e){let n=t(e,this._revealChild);n!==this._revealChild&&(this._revealChild=n,this._applyReveal(),this.notify({eventName:c,object:this}))}get childRevealed(){return this._revealChild}get transitionType(){return this._transitionType}set transitionType(e){this._transitionType=a(e,i,`Gtk.RevealerTransitionType`)}get transitionDuration(){return this._transitionDuration}set transitionDuration(e){this._transitionDuration=Math.max(0,n(e,this._transitionDuration))}_adopt(e){super._adopt(e),this._applyReveal()}_applyReveal(){let e=this.child;e&&(e.visibility=s(this._revealChild))}};export{GtkRevealer,c as NOTIFY_REVEAL_CHILD};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n,xmlNumber as r}from"./xml-values.js";import{GTK_REVEALER_TRANSITIONS as i,transitionNick as a}from"./transition-type.js";import{AdwSingleChildBase as o}from"./single-child-base.js";import{revealerChildVisibility as s}from"./revealer-state.js";const c=`notify::reveal-child`;var GtkRevealer=class extends o{static GTypeName=`GtkRevealer`;static builderSlots=e([`child`],`child`);_revealChild=!1;_transitionType=`slide-down`;_transitionDuration=250;constructor(e){super(),t(this,e)}get revealChild(){return this._revealChild}set revealChild(e){let t=n(e,this._revealChild);t!==this._revealChild&&(this._revealChild=t,this._applyReveal(),this.notify({eventName:c,object:this}))}get childRevealed(){return this._revealChild}get transitionType(){return this._transitionType}set transitionType(e){this._transitionType=a(e,i,`Gtk.RevealerTransitionType`)}get transitionDuration(){return this._transitionDuration}set transitionDuration(e){this._transitionDuration=Math.max(0,r(e,this._transitionDuration))}_adopt(e){super._adopt(e),this._applyReveal()}_applyReveal(){let e=this.child;e&&(e.visibility=s(this._revealChild))}};export{GtkRevealer,c as NOTIFY_REVEAL_CHILD};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{AdwSingleChildBase as r}from"./single-child-base.js";import{DEFAULT_SCROLLBAR_POLICY as i,GTK_POLICY_TYPES as a,normalizePolicy as o,scrollOrientationFor as s}from"./scrolled-window-policy.js";import{GtkAdjustment as c}from"@gjsify/adwaita-core";import{GridLayout as l,ScrollView as u,StackLayout as d}from"@nativescript/core";var GtkScrolledWindow=class extends r{static GTypeName=`GtkScrolledWindow`;static builderSlots=e([`child`],`child`);_scroll=new u;_viewport=new d;_hscrollbarPolicy=i;_vscrollbarPolicy=i;_hasFrame=!1;_hadjustment=null;_vadjustment=null;constructor(e){super(),l.setColumn(this._scroll,0),l.setRow(this._scroll,0),this._scroll.content=this._viewport,this.addChild(this._scroll),this._applyOrientation(),n(this,e)}get hscrollbarPolicy(){return this._hscrollbarPolicy}set hscrollbarPolicy(e){this._hscrollbarPolicy=o(e,`hscrollbar-policy`),this._applyOrientation()}get vscrollbarPolicy(){return this._vscrollbarPolicy}set vscrollbarPolicy(e){this._vscrollbarPolicy=o(e,`vscrollbar-policy`),this._applyOrientation()}get_policy(){return[a.indexOf(this._hscrollbarPolicy),a.indexOf(this._vscrollbarPolicy)]}set_policy(e,t){for(let[n,r]of[[e,`hscrollbar_policy`],[t,`vscrollbar_policy`]])if(!Number.isInteger(n)||a[n]===void 0)throw TypeError(`${n} is not a valid value for enum argument ${r}`);this.hscrollbarPolicy=a[e],this.vscrollbarPolicy=a[t]}get hadjustment(){return this._hadjustment??=new c}get vadjustment(){return this._vadjustment??=new c}get_hadjustment(){return this.hadjustment}get_vadjustment(){return this.vadjustment}set_hadjustment(e){this._hadjustment=e}set_vadjustment(e){this._vadjustment=e}get hasFrame(){return this._hasFrame}set hasFrame(e){this._hasFrame=t(e,this._hasFrame)}_adopt(e){this._viewport.addChild(e)}_release(e){this._viewport.removeChild(e)}_applyOrientation(){let e=s(this._hscrollbarPolicy,this._vscrollbarPolicy);this._scroll.orientation=e,this._viewport.orientation=e}};export{GtkScrolledWindow};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n}from"./xml-values.js";import{AdwSingleChildBase as r}from"./single-child-base.js";import{DEFAULT_SCROLLBAR_POLICY as i,GTK_POLICY_TYPES as a,normalizePolicy as o,scrollOrientationFor as s}from"./scrolled-window-policy.js";import{GtkAdjustment as c}from"@gjsify/adwaita-core";import{ContentView as l,GridLayout as u,ScrollView as d}from"@nativescript/core";var GtkScrolledWindow=class extends r{static GTypeName=`GtkScrolledWindow`;static builderSlots=e([`child`],`child`);_scroll=new d;_viewport=new l;_hscrollbarPolicy=i;_vscrollbarPolicy=i;_hasFrame=!1;_hadjustment=null;_vadjustment=null;constructor(e){super(),u.setColumn(this._scroll,0),u.setRow(this._scroll,0),this._scroll.content=this._viewport,this.addChild(this._scroll),this._applyOrientation(),t(this,e)}get hscrollbarPolicy(){return this._hscrollbarPolicy}set hscrollbarPolicy(e){this._hscrollbarPolicy=o(e,`hscrollbar-policy`),this._applyOrientation()}get vscrollbarPolicy(){return this._vscrollbarPolicy}set vscrollbarPolicy(e){this._vscrollbarPolicy=o(e,`vscrollbar-policy`),this._applyOrientation()}get_policy(){return[a.indexOf(this._hscrollbarPolicy),a.indexOf(this._vscrollbarPolicy)]}set_policy(e,t){for(let[n,r]of[[e,`hscrollbar_policy`],[t,`vscrollbar_policy`]])if(!Number.isInteger(n)||a[n]===void 0)throw TypeError(`${n} is not a valid value for enum argument ${r}`);this.hscrollbarPolicy=a[e],this.vscrollbarPolicy=a[t]}get hadjustment(){return this._hadjustment??=new c}get vadjustment(){return this._vadjustment??=new c}get_hadjustment(){return this.hadjustment}get_vadjustment(){return this.vadjustment}set_hadjustment(e){this._hadjustment=e}set_vadjustment(e){this._vadjustment=e}get hasFrame(){return this._hasFrame}set hasFrame(e){this._hasFrame=n(e,this._hasFrame)}_adopt(e){this._viewport.content=e}_release(e){this._viewport.content===e&&(this._viewport.content=null)}_applyOrientation(){let e=s(this._hscrollbarPolicy,this._vscrollbarPolicy);this._scroll.orientation=e}};export{GtkScrolledWindow};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GTK_STACK_TRANSITIONS as i,transitionNick as a}from"./transition-type.js";import{StyleClassList as o}from"./style-classes.js";import{applyViewStackVisibility as s,createViewStackState as c,viewStackNotifyPayload as l}from"./view-stack-state.js";import{GtkStackPage as u}from"./stack-page.js";import{GridLayout as d,ItemSpec as f}from"@nativescript/core";const p=`notify::visible-child`,m=`notify::visible-child-name`;var GtkStack=class extends r(d){static GTypeName=`GtkStack`;static emittedSignals=[p,m];static builderSlots=[];_state=c();_classList=new o;_transitionType=`none`;_transitionDuration=200;_hhomogeneous=!0;_vhomogeneous=!0;_interpolateSize=!1;constructor(e){super(),this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`)),this._state.subscribe(e=>{s(this._state);let t=l(e);for(let e of[p,m]){let n={eventName:e,object:this,...t};this.notify(n)}}),n(this,e)}add_named(e,t){return this._add(e,t??``)}add_titled(e,t,n){return this._add(e,t??``,n)}add_child(e){return this._add(e,``)}remove(e){let t=this._state.pages.find(t=>t.content===e);return!t||!this._state.removePage(t.name)?!1:(this.removeChild(e),s(this._state),!0)}get_child_by_name(e){return this._state.pages[this._state.indexOfName(e)]?.content??null}setPageVisible(e,t){let n=this._state.setPageVisible(e,t);return s(this._state),n}_addChildFromBuilder(e,t){if(!(t instanceof u)){this._add(t,``);return}let n=t.child;if(n===null){t._awaitChild(this);return}t._adoptBy(this),this._state.addPage({name:t.name,title:t.title,icon:t.iconName,content:n,visible:t.visible,needsAttention:t.needsAttention,useUnderline:t.useUnderline}),this._place(n)}get visibleChildName(){return this._state.visibleName||null}set visibleChildName(e){this._state.setVisibleName(e)}get visibleChild(){return this._state.visiblePage?.content??null}set visibleChild(e){let t=this._state.pages.findIndex(t=>t.content===e);t!==-1&&this._state.setVisibleIndex(t)}get transitionType(){return this._transitionType}set transitionType(e){this._transitionType=a(e,i,`Gtk.StackTransitionType`)}get transitionDuration(){return this._transitionDuration}set transitionDuration(e){this._transitionDuration=Math.max(0,t(e,this._transitionDuration))}get hhomogeneous(){return this._hhomogeneous}set hhomogeneous(t){this._hhomogeneous=e(t,this._hhomogeneous)}get vhomogeneous(){return this._vhomogeneous}set vhomogeneous(t){this._vhomogeneous=e(t,this._vhomogeneous)}get interpolateSize(){return this._interpolateSize}set interpolateSize(t){this._interpolateSize=e(t,this._interpolateSize)}get styleClasses(){return this._classList.classes}set styleClasses(e){this._classList.replace(e),this._restyle()}add_css_class(e){this._classList.add(e),this._restyle()}remove_css_class(e){this._classList.remove(e),this._restyle()}has_css_class(e){return this._classList.has(e)}get_css_classes(){return this._classList.classes}set_css_classes(e){this._classList.replaceAll(e),this._restyle()}_restyle(){this.className=this._classList.className}_add(e,t,n){let r=this._state.addPage({name:t,title:n,content:e});return this._place(e),r}_place(e){d.setColumn(e,0),d.setRow(e,0),this.addChild(e),s(this._state)}};export{GtkStack,p as NOTIFY_STACK_VISIBLE_CHILD,m as NOTIFY_STACK_VISIBLE_CHILD_NAME};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{GTK_STACK_TRANSITIONS as i,transitionNick as a}from"./transition-type.js";import{StyleClassList as o}from"./style-classes.js";import{applyViewStackVisibility as s,createViewStackState as c,viewStackNotifyPayload as l}from"./view-stack-state.js";import{GtkStackPage as u}from"./stack-page.js";import{GridLayout as d,ItemSpec as f}from"@nativescript/core";const p=`notify::visible-child`,m=`notify::visible-child-name`;var GtkStack=class extends r(d){static GTypeName=`GtkStack`;static emittedSignals=[p,m];static builderSlots=[];_state=c();_classList=new o;_transitionType=`none`;_transitionDuration=200;_hhomogeneous=!0;_vhomogeneous=!0;_interpolateSize=!1;constructor(t){super(),this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`)),this._state.subscribe(e=>{s(this._state);let t=l(e);for(let e of[p,m]){let n={eventName:e,object:this,...t};this.notify(n)}}),e(this,t)}add_named(e,t){return this._add(e,t??``)}add_titled(e,t,n){return this._add(e,t??``,n)}add_child(e){return this._add(e,``)}remove(e){let t=this._state.pages.find(t=>t.content===e);return!t||!this._state.removePage(t.name)?!1:(this.removeChild(e),s(this._state),!0)}get_child_by_name(e){return this._state.pages[this._state.indexOfName(e)]?.content??null}setPageVisible(e,t){let n=this._state.setPageVisible(e,t);return s(this._state),n}_addChildFromBuilder(e,t){if(!(t instanceof u)){this._add(t,``);return}let n=t.child;if(n===null){t._awaitChild(this);return}t._adoptBy(this),this._state.addPage({name:t.name,title:t.title,icon:t.iconName,content:n,visible:t.visible,needsAttention:t.needsAttention,useUnderline:t.useUnderline}),this._place(n)}get visibleChildName(){return this._state.visibleName||null}set visibleChildName(e){this._state.setVisibleName(e)}get visibleChild(){return this._state.visiblePage?.content??null}set visibleChild(e){let t=this._state.pages.findIndex(t=>t.content===e);t!==-1&&this._state.setVisibleIndex(t)}get transitionType(){return this._transitionType}set transitionType(e){this._transitionType=a(e,i,`Gtk.StackTransitionType`)}get transitionDuration(){return this._transitionDuration}set transitionDuration(e){this._transitionDuration=Math.max(0,n(e,this._transitionDuration))}get hhomogeneous(){return this._hhomogeneous}set hhomogeneous(e){this._hhomogeneous=t(e,this._hhomogeneous)}get vhomogeneous(){return this._vhomogeneous}set vhomogeneous(e){this._vhomogeneous=t(e,this._vhomogeneous)}get interpolateSize(){return this._interpolateSize}set interpolateSize(e){this._interpolateSize=t(e,this._interpolateSize)}get styleClasses(){return this._classList.classes}set styleClasses(e){this._classList.replace(e),this._restyle()}add_css_class(e){this._classList.add(e),this._restyle()}remove_css_class(e){this._classList.remove(e),this._restyle()}has_css_class(e){return this._classList.has(e)}get_css_classes(){return this._classList.classes}set_css_classes(e){this._classList.replaceAll(e),this._restyle()}_restyle(){this.className=this._classList.className}_add(e,t,n){let r=this._state.addPage({name:t,title:n,content:e});return this._place(e),r}_place(e){d.setColumn(e,0),d.setRow(e,0),this.addChild(e),s(this._state)}};export{GtkStack,p as NOTIFY_STACK_VISIBLE_CHILD,m as NOTIFY_STACK_VISIBLE_CHILD_NAME};