@gjsify/adwaita-nativescript 0.43.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/lib/esm/widgets/adw-about-dialog.js +1 -1
  2. package/lib/esm/widgets/adw-action-row.js +1 -1
  3. package/lib/esm/widgets/adw-avatar.js +1 -1
  4. package/lib/esm/widgets/adw-banner.js +1 -1
  5. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  6. package/lib/esm/widgets/adw-button-content.js +1 -1
  7. package/lib/esm/widgets/adw-carousel.js +1 -1
  8. package/lib/esm/widgets/adw-clamp.js +1 -1
  9. package/lib/esm/widgets/adw-combo-row.js +1 -1
  10. package/lib/esm/widgets/adw-data-grid.js +1 -1
  11. package/lib/esm/widgets/adw-drop-down.js +1 -1
  12. package/lib/esm/widgets/adw-entry-row.js +1 -1
  13. package/lib/esm/widgets/adw-entry.js +1 -1
  14. package/lib/esm/widgets/adw-expander-row.js +1 -1
  15. package/lib/esm/widgets/adw-header-bar.js +1 -1
  16. package/lib/esm/widgets/adw-icon.js +1 -1
  17. package/lib/esm/widgets/adw-image-button.js +1 -1
  18. package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
  19. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  20. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  21. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  22. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  23. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  24. package/lib/esm/widgets/adw-preferences-page.js +1 -1
  25. package/lib/esm/widgets/adw-sidebar.js +1 -1
  26. package/lib/esm/widgets/adw-slider-row.js +1 -1
  27. package/lib/esm/widgets/adw-spin-row.js +1 -1
  28. package/lib/esm/widgets/adw-spinner.js +1 -1
  29. package/lib/esm/widgets/adw-split-button.js +1 -1
  30. package/lib/esm/widgets/adw-status-page.js +1 -1
  31. package/lib/esm/widgets/adw-switch-row.js +1 -1
  32. package/lib/esm/widgets/adw-tab-view.js +1 -1
  33. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  34. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  35. package/lib/esm/widgets/adw-view-stack.js +1 -1
  36. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  37. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  38. package/lib/esm/widgets/builder-slots.js +1 -0
  39. package/lib/esm/widgets/host-insets.android.js +1 -0
  40. package/lib/esm/widgets/host-insets.ios.js +1 -0
  41. package/lib/esm/widgets/host-insets.js +1 -0
  42. package/lib/esm/widgets/icon-path.js +2 -2
  43. package/lib/esm/widgets/icons.android.js +1 -1
  44. package/lib/esm/widgets/icons.ios.js +1 -1
  45. package/lib/esm/widgets/split-view-base.js +1 -1
  46. package/lib/esm/widgets/view-switcher-base.js +1 -1
  47. package/lib/esm/widgets/window-insets.js +1 -1
  48. package/lib/esm/widgets/xml-values.js +1 -0
  49. package/lib/types/widgets/adw-about-dialog.d.ts +1 -1
  50. package/lib/types/widgets/adw-action-row.d.ts +15 -1
  51. package/lib/types/widgets/adw-avatar.d.ts +1 -1
  52. package/lib/types/widgets/adw-banner.d.ts +2 -2
  53. package/lib/types/widgets/adw-bottom-sheet.d.ts +20 -2
  54. package/lib/types/widgets/adw-button-content.d.ts +2 -2
  55. package/lib/types/widgets/adw-carousel.d.ts +14 -3
  56. package/lib/types/widgets/adw-clamp.d.ts +13 -2
  57. package/lib/types/widgets/adw-combo-row.d.ts +1 -1
  58. package/lib/types/widgets/adw-data-grid.d.ts +1 -1
  59. package/lib/types/widgets/adw-drop-down.d.ts +1 -1
  60. package/lib/types/widgets/adw-entry-row.d.ts +4 -4
  61. package/lib/types/widgets/adw-entry.d.ts +2 -2
  62. package/lib/types/widgets/adw-expander-row.d.ts +20 -1
  63. package/lib/types/widgets/adw-header-bar.d.ts +13 -1
  64. package/lib/types/widgets/adw-icon.d.ts +1 -1
  65. package/lib/types/widgets/adw-image-button.d.ts +1 -1
  66. package/lib/types/widgets/adw-navigation-split-view.d.ts +1 -1
  67. package/lib/types/widgets/adw-navigation-view.d.ts +13 -2
  68. package/lib/types/widgets/adw-overlay-split-view.d.ts +1 -1
  69. package/lib/types/widgets/adw-password-entry-row.d.ts +2 -2
  70. package/lib/types/widgets/adw-preferences-dialog.d.ts +7 -1
  71. package/lib/types/widgets/adw-preferences-group.d.ts +11 -0
  72. package/lib/types/widgets/adw-preferences-page.d.ts +7 -1
  73. package/lib/types/widgets/adw-sidebar.d.ts +1 -1
  74. package/lib/types/widgets/adw-slider-row.d.ts +4 -4
  75. package/lib/types/widgets/adw-spin-row.d.ts +4 -4
  76. package/lib/types/widgets/adw-spinner.d.ts +2 -2
  77. package/lib/types/widgets/adw-split-button.d.ts +2 -2
  78. package/lib/types/widgets/adw-status-page.d.ts +7 -0
  79. package/lib/types/widgets/adw-switch-row.d.ts +1 -1
  80. package/lib/types/widgets/adw-tab-view.d.ts +2 -2
  81. package/lib/types/widgets/adw-toggle-group.d.ts +1 -1
  82. package/lib/types/widgets/adw-toolbar-view.d.ts +20 -3
  83. package/lib/types/widgets/adw-view-stack.d.ts +1 -1
  84. package/lib/types/widgets/adw-view-switcher-bar.d.ts +1 -1
  85. package/lib/types/widgets/adw-wrap-box.d.ts +7 -7
  86. package/lib/types/widgets/builder-slots.d.ts +16 -0
  87. package/lib/types/widgets/host-insets.android.d.ts +4 -0
  88. package/lib/types/widgets/host-insets.d.ts +13 -0
  89. package/lib/types/widgets/host-insets.ios.d.ts +4 -0
  90. package/lib/types/widgets/icon-path.d.ts +72 -7
  91. package/lib/types/widgets/index.d.ts +13 -6
  92. package/lib/types/widgets/split-view-base.d.ts +15 -6
  93. package/lib/types/widgets/view-switcher-base.d.ts +1 -1
  94. package/lib/types/widgets/window-insets.d.ts +24 -0
  95. package/lib/types/widgets/xml-values.d.ts +18 -0
  96. package/package.json +11 -8
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{Button as e,GridLayout as t,ItemSpec as n,Label as r,ScrollView as i,StackLayout as a}from"@nativescript/core";import{aboutDialogVisibility as o}from"@gjsify/adwaita-core";const s=`closed`;var AdwAboutDialog=class extends t{_card;_iconLabel;_nameLabel;_versionLabel;_developerLabel;_commentsLabel;_websiteLabel;_copyrightLabel;_applicationName=``;_applicationIcon=``;_developerName=``;_version=``;_comments=``;_website=``;_copyright=``;constructor(){super(),this.className=`adw-about-dialog`,this.visibility=`collapse`,this.addColumn(new n(1,`star`)),this.addRow(new n(1,`star`));let r=new i;r.orientation=`vertical`,r.verticalAlignment=`middle`,r.horizontalAlignment=`center`,t.setColumn(r,0),t.setRow(r,0);let o=new a;o.orientation=`vertical`,o.className=`adw-about-dialog-card`,r.content=o,this.addChild(r),this._card=o,this._iconLabel=this._addCardLabel(o,`adw-about-dialog-icon`),this._nameLabel=this._addCardLabel(o,`adw-about-dialog-name`),this._versionLabel=this._addCardLabel(o,`adw-about-dialog-version`),this._developerLabel=this._addCardLabel(o,`adw-about-dialog-developer`),this._commentsLabel=this._addCardLabel(o,`adw-about-dialog-comments`),this._websiteLabel=this._addCardLabel(o,`adw-about-dialog-website`),this._copyrightLabel=this._addCardLabel(o,`adw-about-dialog-copyright`);let s=new e;s.text=`Close`,s.className=`adw-about-dialog-close`,s.set(`androidElevation`,0),s.addEventListener(`tap`,()=>this.close()),o.addChild(s),this._render()}_addCardLabel(e,t){let n=new r;return n.className=t,n.horizontalAlignment=`center`,n.textWrap=!0,e.addChild(n),n}get applicationName(){return this._applicationName}set applicationName(e){this._applicationName=e??``,this._render()}get applicationIcon(){return this._applicationIcon}set applicationIcon(e){this._applicationIcon=e??``,this._render()}get version(){return this._version}set version(e){this._version=e??``,this._render()}get developerName(){return this._developerName}set developerName(e){this._developerName=e??``,this._render()}get comments(){return this._comments}set comments(e){this._comments=e??``,this._render()}get website(){return this._website}set website(e){this._website=e??``,this._render()}get copyright(){return this._copyright}set copyright(e){this._copyright=e??``,this._render()}_render(){let e=o({applicationName:this._applicationName,applicationIcon:this._applicationIcon,developerName:this._developerName,version:this._version,comments:this._comments,website:this._website}),show=(e,t,n)=>{e.text=t,e.visibility=n?`visible`:`collapse`};show(this._iconLabel,this._applicationIcon,e.appIcon),show(this._nameLabel,this._applicationName,e.appName),show(this._versionLabel,this._version,e.version),show(this._developerLabel,this._developerName,e.developerName),show(this._commentsLabel,this._comments,e.commentsLabel),show(this._websiteLabel,this._website,e.websiteRow),show(this._copyrightLabel,this._copyright,this._copyright.length>0)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:s,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(e){e?this.present():this.close()}};export{AdwAboutDialog,s as CLOSED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{Button as t,GridLayout as n,ItemSpec as r,Label as i,ScrollView as a,StackLayout as o}from"@nativescript/core";import{aboutDialogVisibility as s}from"@gjsify/adwaita-core";const c=`closed`;var AdwAboutDialog=class extends n{_card;_iconLabel;_nameLabel;_versionLabel;_developerLabel;_commentsLabel;_websiteLabel;_copyrightLabel;_applicationName=``;_applicationIcon=``;_developerName=``;_version=``;_comments=``;_website=``;_copyright=``;constructor(){super(),this.className=`adw-about-dialog`,this.visibility=`collapse`,this.addColumn(new r(1,`star`)),this.addRow(new r(1,`star`));let e=new a;e.orientation=`vertical`,e.verticalAlignment=`middle`,e.horizontalAlignment=`center`,n.setColumn(e,0),n.setRow(e,0);let i=new o;i.orientation=`vertical`,i.className=`adw-about-dialog-card`,e.content=i,this.addChild(e),this._card=i,this._iconLabel=this._addCardLabel(i,`adw-about-dialog-icon`),this._nameLabel=this._addCardLabel(i,`adw-about-dialog-name`),this._versionLabel=this._addCardLabel(i,`adw-about-dialog-version`),this._developerLabel=this._addCardLabel(i,`adw-about-dialog-developer`),this._commentsLabel=this._addCardLabel(i,`adw-about-dialog-comments`),this._websiteLabel=this._addCardLabel(i,`adw-about-dialog-website`),this._copyrightLabel=this._addCardLabel(i,`adw-about-dialog-copyright`);let s=new t;s.text=`Close`,s.className=`adw-about-dialog-close`,s.set(`androidElevation`,0),s.addEventListener(`tap`,()=>this.close()),i.addChild(s),this._render()}_addCardLabel(e,t){let n=new i;return n.className=t,n.horizontalAlignment=`center`,n.textWrap=!0,e.addChild(n),n}get applicationName(){return this._applicationName}set applicationName(e){this._applicationName=e??``,this._render()}get applicationIcon(){return this._applicationIcon}set applicationIcon(e){this._applicationIcon=e??``,this._render()}get version(){return this._version}set version(e){this._version=e??``,this._render()}get developerName(){return this._developerName}set developerName(e){this._developerName=e??``,this._render()}get comments(){return this._comments}set comments(e){this._comments=e??``,this._render()}get website(){return this._website}set website(e){this._website=e??``,this._render()}get copyright(){return this._copyright}set copyright(e){this._copyright=e??``,this._render()}_render(){let e=s({applicationName:this._applicationName,applicationIcon:this._applicationIcon,developerName:this._developerName,version:this._version,comments:this._comments,website:this._website}),show=(e,t,n)=>{e.text=t,e.visibility=n?`visible`:`collapse`};show(this._iconLabel,this._applicationIcon,e.appIcon),show(this._nameLabel,this._applicationName,e.appName),show(this._versionLabel,this._version,e.version),show(this._developerLabel,this._developerName,e.developerName),show(this._commentsLabel,this._comments,e.commentsLabel),show(this._websiteLabel,this._website,e.websiteRow),show(this._copyrightLabel,this._copyright,this._copyright.length>0)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:c,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(t){e(t,!1)?this.present():this.close()}};export{AdwAboutDialog,c as CLOSED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{ActionRowState as e,isViewSensitive as t,rowLabelVisuals as n}from"./row-state.js";import{GridLayout as r,ItemSpec as i,Label as a,StackLayout as o}from"@nativescript/core";const s=`activated`;var AdwActionRow=class extends r{isActionRow=!0;_textStack;_titleLabel;_subtitleLabel;_rowState=new e;_prefix=null;_suffix=null;constructor(){super(),this.className=`adw-row adw-action-row`,this.addColumn(new i(1,`auto`)),this.addColumn(new i(1,`star`)),this.addColumn(new i(1,`auto`)),this.addRow(new i(1,`auto`));let e=new o;e.orientation=`vertical`,e.className=`adw-row-text`,r.setColumn(e,1);let t=new a;t.className=`adw-row-title`,t.textWrap=!0,e.addChild(t);let n=new a;n.className=`adw-row-subtitle`,n.textWrap=!0,e.addChild(n),this.addChild(e),this._textStack=e,this._titleLabel=t,this._subtitleLabel=n,this._applyLabels(),this.addEventListener(`tap`,()=>this.activate())}setPrefix(e){this._prefix&&=(this.removeChild(this._prefix),null),e&&(e.className=`${e.className??``} adw-row-prefix`.trim(),r.setColumn(e,0),this.addChild(e),this._prefix=e)}get prefix(){return this._prefix}get title(){return this._rowState.title}set title(e){this._rowState.setTitle(e)&&this._applyLabels()}get subtitle(){return this._rowState.subtitle}set subtitle(e){this._rowState.setSubtitle(e)&&this._applyLabels()}setSuffix(e){this._suffix&&=(this.removeChild(this._suffix),null),e&&(e.className=`${e.className??``} adw-row-suffix`.trim(),r.setColumn(e,2),this.addChild(e),this._suffix=e)}get suffix(){return this._suffix}get activatableWidget(){return this._rowState.activatableWidget}set activatableWidget(e){this._rowState.setActivatableWidget(e,t(e))}syncActivatableWidgetSensitivity(){let e=this._rowState.activatableWidget;e&&this._rowState.setActivatableWidgetSensitive(t(e))}get activatable(){return this._rowState.activatable}set activatable(e){this._rowState.setActivatable(e)}activate(){if(!this._rowState.activatable)return;let e={eventName:s,object:this};this.notify(e)}_managesTitleVisibility=!0;_applyLabels(){let e=n({title:this._rowState.title,subtitle:this._rowState.subtitle});this._titleLabel.text=e.title,this._managesTitleVisibility&&(this._titleLabel.visibility=e.titleVisibility),this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}};export{s as ACTIVATED,AdwActionRow};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{resolveBuilderSlot as t}from"./builder-slots.js";import{ActionRowState as n,isViewSensitive as r,rowLabelVisuals as i}from"./row-state.js";import{GridLayout as a,ItemSpec as o,Label as s,StackLayout as c}from"@nativescript/core";const l=`activated`,u=[`prefix`,`suffix`];var AdwActionRow=class extends a{isActionRow=!0;_textStack;_titleLabel;_subtitleLabel;_rowState=new n;_prefix=null;_suffix=null;constructor(){super(),this.className=`adw-row adw-action-row`,this.addColumn(new o(1,`auto`)),this.addColumn(new o(1,`star`)),this.addColumn(new o(1,`auto`)),this.addRow(new o(1,`auto`));let e=new c;e.orientation=`vertical`,e.className=`adw-row-text`,a.setColumn(e,1);let t=new s;t.className=`adw-row-title`,t.textWrap=!0,e.addChild(t);let n=new s;n.className=`adw-row-subtitle`,n.textWrap=!0,e.addChild(n),this.addChild(e),this._textStack=e,this._titleLabel=t,this._subtitleLabel=n,this._applyLabels(),this.addEventListener(`tap`,()=>this.activate())}setPrefix(e){this._prefix&&=(this.removeChild(this._prefix),null),e&&(e.className=`${e.className??``} adw-row-prefix`.trim(),a.setColumn(e,0),this.addChild(e),this._prefix=e)}get prefix(){return this._prefix}get title(){return this._rowState.title}set title(e){this._rowState.setTitle(e)&&this._applyLabels()}get subtitle(){return this._rowState.subtitle}set subtitle(e){this._rowState.setSubtitle(e)&&this._applyLabels()}setSuffix(e){this._suffix&&=(this.removeChild(this._suffix),null),e&&(e.className=`${e.className??``} adw-row-suffix`.trim(),a.setColumn(e,2),this.addChild(e),this._suffix=e)}get suffix(){return this._suffix}_addChildFromBuilder(e,n){t(e,u,`suffix`)===`prefix`?this.setPrefix(n):this.setSuffix(n)}get activatableWidget(){return this._rowState.activatableWidget}set activatableWidget(e){this._rowState.setActivatableWidget(e,r(e))}syncActivatableWidgetSensitivity(){let e=this._rowState.activatableWidget;e&&this._rowState.setActivatableWidgetSensitive(r(e))}get activatable(){return this._rowState.activatable}set activatable(t){this._rowState.setActivatable(e(t,!1))}activate(){if(!this._rowState.activatable)return;let e={eventName:l,object:this};this.notify(e)}_managesTitleVisibility=!0;_applyLabels(){let e=i({title:this._rowState.title,subtitle:this._rowState.subtitle});this._titleLabel.text=e.title,this._managesTitleVisibility&&(this._titleLabel.visibility=e.titleVisibility),this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}};export{l as ACTIVATED,AdwActionRow};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{avatarColor as e,avatarInitials as t}from"./avatar-color.js";import{GridLayout as n,ItemSpec as r,Label as i}from"@nativescript/core";import{avatarMaxFontSize as a}from"@gjsify/adwaita-core";const o=48;var AdwAvatar=class extends n{_label;_text=``;_size=48;constructor(){super(),this.className=`adw-avatar`,this.addColumn(new r(1,`star`)),this.addRow(new r(1,`star`));let e=new i;e.className=`adw-avatar-label`,e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,n.setColumn(e,0),n.setRow(e,0),this.addChild(e),this._label=e,this._applySize()}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(Math.min(this._size*.4,a(this._size))))}get text(){return this._text}set text(n){this._text=n??``,this._label.text=t(this._text);let{fill:r,fg:i}=e(this._text);this.set(`backgroundColor`,r),this._label.set(`color`,i)}get size(){return this._size}set size(e){this._size=Number.isFinite(e)&&e>0?e:48,this._applySize()}};export{AdwAvatar,o as DEFAULT_AVATAR_SIZE,e as avatarColor,t as avatarInitials};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{avatarColor as t,avatarInitials as n}from"./avatar-color.js";import{GridLayout as r,ItemSpec as i,Label as a}from"@nativescript/core";import{avatarMaxFontSize as o}from"@gjsify/adwaita-core";const s=48;var AdwAvatar=class extends r{_label;_text=``;_size=48;constructor(){super(),this.className=`adw-avatar`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let e=new a;e.className=`adw-avatar-label`,e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,r.setColumn(e,0),r.setRow(e,0),this.addChild(e),this._label=e,this._applySize()}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(Math.min(this._size*.4,o(this._size))))}get text(){return this._text}set text(e){this._text=e??``,this._label.text=n(this._text);let{fill:r,fg:i}=t(this._text);this.set(`backgroundColor`,r),this._label.set(`color`,i)}get size(){return this._size}set size(t){let n=e(t,48);this._size=n>0?n:48,this._applySize()}};export{AdwAvatar,s as DEFAULT_AVATAR_SIZE,t as avatarColor,n as avatarInitials};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{bannerButtonClassName as e,bannerTitleText as t,bannerVisibility as n,defaultBannerProps as r}from"./chrome.js";import{Button as i,GridLayout as a,ItemSpec as o,Label as s}from"@nativescript/core";import{bannerButtonText as c,bannerButtonVisible as l,parseBannerButtonStyle as u}from"@gjsify/adwaita-core";const d=`buttonClicked`;var AdwBanner=class extends a{_titleLabel;_button;_hasButton=!1;_props=r();constructor(){super(),this.className=`adw-banner`,this.addColumn(new o(1,`star`)),this.addColumn(new o(1,`auto`)),this.addRow(new o(1,`auto`));let e=new s;e.className=`adw-banner-title`,e.textWrap=!0,a.setColumn(e,0),this.addChild(e),this._titleLabel=e;let t=new i;t.className=`adw-banner-button`,t.set(`androidElevation`,0),a.setColumn(t,1),this._button=t,t.addEventListener(`tap`,()=>{let e={eventName:d,object:this};this.notify(e)}),this.visibility=n(this._props.revealed)}get title(){return this._props.title}set title(e){this._props.title=e??``,this._renderTitle()}get useMarkup(){return this._props.useMarkup}set useMarkup(e){this._props.useMarkup=!!e,this._renderTitle()}get buttonLabel(){return this._props.buttonLabel}set buttonLabel(e){let t=e??``;this._props.buttonLabel=t,this._button.text=c(t);let n=l(t);n&&!this._hasButton?(this.addChild(this._button),this._hasButton=!0):!n&&this._hasButton&&(this.removeChild(this._button),this._hasButton=!1)}get buttonStyle(){return this._props.buttonStyle}set buttonStyle(t){this._props.buttonStyle=u(t),this._button.className=e(this._button.className,this._props.buttonStyle)}get revealed(){return this._props.revealed}set revealed(e){this._props.revealed=!!e,this.visibility=n(this._props.revealed)}_renderTitle(){this._titleLabel.text=t(this._props.title,this._props.useMarkup)}};export{AdwBanner,d as BUTTON_CLICKED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{bannerButtonClassName as t,bannerTitleText as n,bannerVisibility as r,defaultBannerProps as i}from"./chrome.js";import{Button as a,GridLayout as o,ItemSpec as s,Label as c}from"@nativescript/core";import{bannerButtonText as l,bannerButtonVisible as u,parseBannerButtonStyle as d}from"@gjsify/adwaita-core";const f=`buttonClicked`;var AdwBanner=class extends o{_titleLabel;_button;_hasButton=!1;_props=i();constructor(){super(),this.className=`adw-banner`,this.addColumn(new s(1,`star`)),this.addColumn(new s(1,`auto`)),this.addRow(new s(1,`auto`));let e=new c;e.className=`adw-banner-title`,e.textWrap=!0,o.setColumn(e,0),this.addChild(e),this._titleLabel=e;let t=new a;t.className=`adw-banner-button`,t.set(`androidElevation`,0),o.setColumn(t,1),this._button=t,t.addEventListener(`tap`,()=>{let e={eventName:f,object:this};this.notify(e)}),this.visibility=r(this._props.revealed)}get title(){return this._props.title}set title(e){this._props.title=e??``,this._renderTitle()}get useMarkup(){return this._props.useMarkup}set useMarkup(t){this._props.useMarkup=e(t,!1),this._renderTitle()}get buttonLabel(){return this._props.buttonLabel}set buttonLabel(e){let t=e??``;this._props.buttonLabel=t,this._button.text=l(t);let n=u(t);n&&!this._hasButton?(this.addChild(this._button),this._hasButton=!0):!n&&this._hasButton&&(this.removeChild(this._button),this._hasButton=!1)}get buttonStyle(){return this._props.buttonStyle}set buttonStyle(e){this._props.buttonStyle=d(e),this._button.className=t(this._button.className,this._props.buttonStyle)}get revealed(){return this._props.revealed}set revealed(t){this._props.revealed=e(t,!1),this.visibility=r(this._props.revealed)}_renderTitle(){this._titleLabel.text=n(this._props.title,this._props.useMarkup)}};export{AdwBanner,f as BUTTON_CLICKED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{CLOSE_ATTEMPT as e,NOTIFY_OPEN as t,SHEET_CLOSE as n,addMarkerClass as r,applySheetVisibility as i,createBottomSheetPresentation as a,removeMarkerClass as o,requestBottomSheetClose as s,sheetVisibility as c}from"./bottom-sheet-state.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";const p=`adw-bottom-sheet-content`,m=`adw-bottom-sheet-sheet`;var AdwBottomSheet=class extends l{_content=null;_sheetPanel;_sheetChild=null;_state=a();constructor(){super(),this.className=`adw-bottom-sheet`,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`star`));let e=new f;e.orientation=`vertical`,e.className=`adw-bottom-sheet-panel`,e.verticalAlignment=`bottom`,e.visibility=c(this._state.open),l.setColumn(e,0),l.setRow(e,0);let n=new d;n.text=`━`,n.className=`adw-bottom-sheet-handle`,n.horizontalAlignment=`center`,n.isUserInteractionEnabled=!1,e.addChild(n),this.addChild(e),this._sheetPanel=e,this._state.subscribe(e=>{i(this._sheetPanel,e);let n={eventName:t,object:this,open:e};this.notify(n)})}setContent(e){this._content!==e&&(this._content&&(this._content.className=o(this._content.className,p),this.removeChild(this._content)),this._content=e,e&&(e.className=r(e.className,p),l.setColumn(e,0),l.setRow(e,0),this.insertChild(e,0)))}setSheet(e){this._sheetChild!==e&&(this._sheetChild&&(this._sheetChild.className=o(this._sheetChild.className,m),this._sheetPanel.removeChild(this._sheetChild)),this._sheetChild=e,e&&(e.className=r(e.className,m),this._sheetPanel.addChild(e)))}open(){this.openState=!0}close(){this.openState=!1}get openState(){return this._state.open}set openState(e){this._state.setOpen(e)}get canClose(){return this._state.canClose}set canClose(e){this._state.setCanClose(e)}requestClose(e){let{outcome:t,eventName:n}=s(this._state,e);return n&&this.notify({eventName:n,object:this}),t}};export{AdwBottomSheet,e as CLOSE_ATTEMPT,t as NOTIFY_OPEN,n as SHEET_CLOSE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{resolveBuilderSlot as t}from"./builder-slots.js";import{CLOSE_ATTEMPT as n,NOTIFY_OPEN as r,SHEET_CLOSE as i,addMarkerClass as a,applySheetVisibility as o,createBottomSheetPresentation as s,removeMarkerClass as c,requestBottomSheetClose as l,sheetVisibility as u}from"./bottom-sheet-state.js";import{GridLayout as d,ItemSpec as f,Label as p,StackLayout as m}from"@nativescript/core";const h=`adw-bottom-sheet-content`,g=`adw-bottom-sheet-sheet`,_=[`sheet`,`content`];var AdwBottomSheet=class extends d{_content=null;_sheetPanel;_sheetChild=null;_state=s();constructor(){super(),this.className=`adw-bottom-sheet`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`));let e=new m;e.orientation=`vertical`,e.className=`adw-bottom-sheet-panel`,e.verticalAlignment=`bottom`,e.visibility=u(this._state.open),d.setColumn(e,0),d.setRow(e,0);let t=new p;t.text=`━`,t.className=`adw-bottom-sheet-handle`,t.horizontalAlignment=`center`,t.isUserInteractionEnabled=!1,e.addChild(t),this.addChild(e),this._sheetPanel=e,this._state.subscribe(e=>{o(this._sheetPanel,e);let t={eventName:r,object:this,open:e};this.notify(t)})}setContent(e){this._content!==e&&(this._content&&(this._content.className=c(this._content.className,h),this.removeChild(this._content)),this._content=e,e&&(e.className=a(e.className,h),d.setColumn(e,0),d.setRow(e,0),this.insertChild(e,0)))}setSheet(e){this._sheetChild!==e&&(this._sheetChild&&(this._sheetChild.className=c(this._sheetChild.className,g),this._sheetPanel.removeChild(this._sheetChild)),this._sheetChild=e,e&&(e.className=a(e.className,g),this._sheetPanel.addChild(e)))}_addChildFromBuilder(e,n){t(e,_,`content`)===`sheet`?this.setSheet(n):this.setContent(n)}get content(){return this._content}get sheet(){return this._sheetChild}open(){this.openState=!0}close(){this.openState=!1}get openState(){return this._state.open}set openState(t){this._state.setOpen(e(t,!1))}get canClose(){return this._state.canClose}set canClose(t){let n=e(t,this.canClose);this._state.setCanClose(n)}requestClose(e){let{outcome:t,eventName:n}=l(this._state,e);return n&&this.notify({eventName:n,object:this}),t}};export{AdwBottomSheet,n as CLOSE_ATTEMPT,r as NOTIFY_OPEN,i as SHEET_CLOSE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{buttonContentClassName as t,buttonContentEllipsize as n,buttonContentIconIsFallback as r,buttonContentIconSvg as i,buttonContentLabelText as a,buttonContentLabelVisibility as o,buttonContentRootedParentClassName as s,buttonContentUnrootedParentClassName as c}from"./button-content.js";import{Label as l,StackLayout as u}from"@nativescript/core";import{ADW_BUTTON_CONTENT_DEFAULTS as d}from"@gjsify/adwaita-core";var AdwButtonContent=class extends u{_icon;_label;_props={...d};_hostButton=null;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-button-content`,this.horizontalAlignment=`center`;let t=new e;t.className=`${t.className} adw-button-content-icon`.trim(),t.verticalAlignment=`middle`,t.icon=i(``),this.addChild(t),this._icon=t;let n=new l;n.className=`adw-button-content-label`,n.verticalAlignment=`middle`,n.visibility=o(``),this.addChild(n),this._label=n}get hostButton(){return this._hostButton}set hostButton(e){this._hostButton!==e&&(this._hostButton&&(this._hostButton.className=c(this._hostButton.className??``)),this._hostButton=e,e&&(e.className=s(e.className??``)))}get icon(){return this._props.iconName}set icon(e){this._props.iconName=e??``,this._icon.icon=i(this._props.iconName)}get iconIsFallback(){return r(this._props.iconName)}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get label(){return this._props.label}set label(e){this._props.label=e??``,this._renderLabel()}get useUnderline(){return this._props.useUnderline}set useUnderline(e){this._props.useUnderline=!!e,this._renderLabel()}get canShrink(){return this._props.canShrink}set canShrink(e){this._props.canShrink=!!e,this.className=t(this.className,this._props.canShrink)}get ellipsize(){return n(this._props.canShrink)}_renderLabel(){this._label.text=a(this._props.label,this._props.useUnderline),this._label.visibility=o(this._props.label)}};export{AdwButtonContent};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{buttonContentClassName as n,buttonContentEllipsize as r,buttonContentIconIsFallback as i,buttonContentIconSvg as a,buttonContentLabelText as o,buttonContentLabelVisibility as s,buttonContentRootedParentClassName as c,buttonContentUnrootedParentClassName as l}from"./button-content.js";import{Label as u,StackLayout as d}from"@nativescript/core";import{ADW_BUTTON_CONTENT_DEFAULTS as f}from"@gjsify/adwaita-core";var AdwButtonContent=class extends d{_icon;_label;_props={...f};_hostButton=null;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-button-content`,this.horizontalAlignment=`center`;let e=new t;e.className=`${e.className} adw-button-content-icon`.trim(),e.verticalAlignment=`middle`,e.icon=a(``),this.addChild(e),this._icon=e;let n=new u;n.className=`adw-button-content-label`,n.verticalAlignment=`middle`,n.visibility=s(``),this.addChild(n),this._label=n}get hostButton(){return this._hostButton}set hostButton(e){this._hostButton!==e&&(this._hostButton&&(this._hostButton.className=l(this._hostButton.className??``)),this._hostButton=e,e&&(e.className=c(e.className??``)))}get icon(){return this._props.iconName}set icon(e){this._props.iconName=e??``,this._icon.icon=a(this._props.iconName)}get iconIsFallback(){return i(this._props.iconName)}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get label(){return this._props.label}set label(e){this._props.label=e??``,this._renderLabel()}get useUnderline(){return this._props.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._props.useUnderline=!!n,this._renderLabel()}get canShrink(){return this._props.canShrink}set canShrink(t){let r=e(t,this.canShrink);this._props.canShrink=!!r,this.className=n(this.className,this._props.canShrink)}get ellipsize(){return r(this._props.canShrink)}_renderLabel(){this._label.text=o(this._props.label,this._props.useUnderline),this._label.visibility=s(this._props.label)}};export{AdwButtonContent};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{CarouselScrollSync as e,DEFAULT_CAROUSEL_PAGE_WIDTH as t,applyCarouselDots as n,carouselNotifyPayload as r,carouselPositionAtOffset as i,carouselScrollOffset as a,createCarouselState as o,normalizeCarouselPageWidth as s}from"./carousel-state.js";import{GridLayout as c,ItemSpec as l,Label as u,ScrollView as d,StackLayout as f}from"@nativescript/core";const p=`notify::position`,m=`notify::n-pages`,h=`page-changed`;var AdwCarousel=class extends c{_scroller;_track;_dots;_state=o({onScrollTo:e=>this._performScroll(e)});_sync=new e;_views=new Map;_dotsById=new Map;_nextPageId=0;_pageWidth=320;constructor(){super(),this.className=`adw-carousel`,this.addColumn(new l(1,`star`)),this.addRow(new l(1,`star`)),this.addRow(new l(1,`auto`));let e=new d;e.orientation=`horizontal`,e.className=`adw-carousel-scroller`,c.setRow(e,0);let t=new f;t.orientation=`horizontal`,t.className=`adw-carousel-track`,e.content=t,this.addChild(e),this._scroller=e,this._track=t;let a=new f;a.orientation=`horizontal`,a.className=`adw-carousel-dots`,a.horizontalAlignment=`center`,c.setRow(a,1),this.addChild(a),this._dots=a,e.addEventListener(`scroll`,e=>{let t=i(e.scrollX,this._distance());this._sync.apply(this._state,t)}),this._state.subscribe(e=>{n(this._state,this._orderedDots());let t={eventName:e.reason===`n-pages`?m:p,object:this,...r(e)};this.notify(t)}),this._state.onPageChanged(e=>{let t={eventName:h,object:this,index:e};this.notify(t)})}addPage(e){this.insertPage(e,-1)}insertPage(e,t=-1){let n=`page-${this._nextPageId++}`;e.width=this._pageWidth,e.className=`${e.className??``} adw-carousel-page`.trim();let r=new u;return r.text=`●`,r.className=`adw-carousel-dot`,r.addEventListener(`tap`,()=>this.scrollToPage(this._state.indexOf(n))),this._views.set(n,e),this._dotsById.set(n,r),this._state.insertPage(n,t)?(this._state.skipReveal(n),this._syncTrack(),!0):(this._views.delete(n),this._dotsById.delete(n),!1)}removePage(e){let t=this._idOf(e);return t===null||!this._state.removePage(t)?!1:(this._state.skipReveal(t),this._views.delete(t),this._dotsById.delete(t),this._syncTrack(),!0)}reorderPage(e,t){let n=this._idOf(e);return n===null||!this._state.reorderPage(n,t)?!1:(this._syncTrack(),!0)}scrollToPage(e){this._state.scrollTo(e,{interactive:!0})}navigate(e){return this._state.navigate(e)}get nPages(){return this._state.nPages}get position(){return this._state.position}set position(e){if(!Number.isFinite(e))return;let t=this._state.pageAt(e);t>=0&&this.scrollToPage(t)}get currentPage(){return this._state.pageAt(this._state.position)}get interactive(){return this._state.interactive}set interactive(e){this._state.setInteractive(e)}get pageWidth(){return this._pageWidth}set pageWidth(e){this._pageWidth=s(e);for(let e of this._views.values())e.width=this._pageWidth}_distance(){return this._state.pageDistance(this._pageWidth)}_idOf(e){for(let[t,n]of this._views)if(n===e)return t;return null}_performScroll(e){this._sync.expect(e.position),this._scroller.scrollToHorizontalOffset(a(e.position,this._distance()),!0)}_orderedDots(){let e=[];for(let t of this._state.ids){let n=this._dotsById.get(t);n&&e.push(n)}return e}_syncTrack(){for(;this._track.getChildrenCount()>0;)this._track.removeChild(this._track.getChildAt(0));for(;this._dots.getChildrenCount()>0;)this._dots.removeChild(this._dots.getChildAt(0));let e=this._orderedDots();for(let e of this._state.ids){let t=this._views.get(e);t&&this._track.addChild(t)}for(let t of e)this._dots.addChild(t);n(this._state,e)}};export{AdwCarousel,t as DEFAULT_CAROUSEL_PAGE_WIDTH,m as NOTIFY_N_PAGES,p as NOTIFY_POSITION,h as PAGE_CHANGED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{CarouselScrollSync as n,DEFAULT_CAROUSEL_PAGE_WIDTH as r,applyCarouselDots as i,carouselNotifyPayload as a,carouselPositionAtOffset as o,carouselScrollOffset as s,createCarouselState as c,normalizeCarouselPageWidth as l}from"./carousel-state.js";import{GridLayout as u,ItemSpec as d,Label as f,ScrollView as p,StackLayout as m}from"@nativescript/core";const h=`notify::position`,g=`notify::n-pages`,_=`page-changed`;var AdwCarousel=class extends u{_scroller;_track;_dots;_state=c({onScrollTo:e=>this._performScroll(e)});_sync=new n;_views=new Map;_dotsById=new Map;_nextPageId=0;_pageWidth=320;constructor(){super(),this.className=`adw-carousel`,this.addColumn(new d(1,`star`)),this.addRow(new d(1,`star`)),this.addRow(new d(1,`auto`));let e=new p;e.orientation=`horizontal`,e.className=`adw-carousel-scroller`,u.setRow(e,0);let t=new m;t.orientation=`horizontal`,t.className=`adw-carousel-track`,e.content=t,this.addChild(e),this._scroller=e,this._track=t;let n=new m;n.orientation=`horizontal`,n.className=`adw-carousel-dots`,n.horizontalAlignment=`center`,u.setRow(n,1),this.addChild(n),this._dots=n,e.addEventListener(`scroll`,e=>{let t=o(e.scrollX,this._distance());this._sync.apply(this._state,t)}),this._state.subscribe(e=>{i(this._state,this._orderedDots());let t={eventName:e.reason===`n-pages`?g:h,object:this,...a(e)};this.notify(t)}),this._state.onPageChanged(e=>{let t={eventName:_,object:this,index:e};this.notify(t)})}addPage(e){this.insertPage(e,-1)}_addChildFromBuilder(e,t){this.addPage(t)}insertPage(e,t=-1){let n=`page-${this._nextPageId++}`;e.width=this._pageWidth,e.className=`${e.className??``} adw-carousel-page`.trim();let r=new f;return r.text=`●`,r.className=`adw-carousel-dot`,r.addEventListener(`tap`,()=>this.scrollToPage(this._state.indexOf(n))),this._views.set(n,e),this._dotsById.set(n,r),this._state.insertPage(n,t)?(this._state.skipReveal(n),this._syncTrack(),!0):(this._views.delete(n),this._dotsById.delete(n),!1)}removePage(e){let t=this._idOf(e);return t===null||!this._state.removePage(t)?!1:(this._state.skipReveal(t),this._views.delete(t),this._dotsById.delete(t),this._syncTrack(),!0)}reorderPage(e,t){let n=this._idOf(e);return n===null||!this._state.reorderPage(n,t)?!1:(this._syncTrack(),!0)}scrollToPage(e){this._state.scrollTo(e,{interactive:!0})}navigate(e){return this._state.navigate(e)}get pages(){let e=[];for(let t=0;t<this._track.getChildrenCount();t++)e.push(this._track.getChildAt(t));return e}get nPages(){return this._state.nPages}get position(){return this._state.position}set position(e){let n=t(e,this.position);if(!Number.isFinite(n))return;let r=this._state.pageAt(n);r>=0&&this.scrollToPage(r)}get currentPage(){return this._state.pageAt(this._state.position)}get interactive(){return this._state.interactive}set interactive(t){let n=e(t,this.interactive);this._state.setInteractive(n)}get pageWidth(){return this._pageWidth}set pageWidth(e){let n=t(e,this.pageWidth);this._pageWidth=l(n);for(let e of this._views.values())e.width=this._pageWidth}_distance(){return this._state.pageDistance(this._pageWidth)}_idOf(e){for(let[t,n]of this._views)if(n===e)return t;return null}_performScroll(e){this._sync.expect(e.position),this._scroller.scrollToHorizontalOffset(s(e.position,this._distance()),!0)}_orderedDots(){let e=[];for(let t of this._state.ids){let n=this._dotsById.get(t);n&&e.push(n)}return e}_syncTrack(){for(;this._track.getChildrenCount()>0;)this._track.removeChild(this._track.getChildAt(0));for(;this._dots.getChildrenCount()>0;)this._dots.removeChild(this._dots.getChildAt(0));let e=this._orderedDots();for(let e of this._state.ids){let t=this._views.get(e);t&&this._track.addChild(t)}for(let t of e)this._dots.addChild(t);i(this._state,e)}};export{AdwCarousel,r as DEFAULT_CAROUSEL_PAGE_WIDTH,g as NOTIFY_N_PAGES,h as NOTIFY_POSITION,_ as PAGE_CHANGED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{DEFAULT_CLAMP_MAX_SIZE as e,DEFAULT_CLAMP_TIGHTENING_THRESHOLD as t,clampAllocationFor as n,clampChildClassName as r,defaultClampProps as i,normalizeClampProp as a}from"./chrome.js";import{GridLayout as o,ItemSpec as s}from"@nativescript/core";var AdwClamp=class extends o{_props=i();_child=null;_measuredWidth=0;constructor(){super(),this.className=`adw-clamp`,this.addColumn(new s(1,`star`)),this.addRow(new s(1,`auto`)),this.addEventListener(`layoutChanged`,()=>this._allocate())}setChild(e){this._child&&=(this._child.className=r(this._child.className,null),this.removeChild(this._child),null),e&&(e.horizontalAlignment=`center`,o.setColumn(e,0),o.setRow(e,0),this.addChild(e),this._child=e,this._allocate())}get child(){return this._child}get maximumSize(){return this._props.maximumSize}set maximumSize(t){this._props.maximumSize=a(t,e),this._allocate()}get tighteningThreshold(){return this._props.tighteningThreshold}set tighteningThreshold(e){this._props.tighteningThreshold=a(e,t),this._allocate()}_allocate(){let e=this.getActualSize?.();if(e&&e.width>0&&(this._measuredWidth=e.width),!this._child)return;let{width:t,sizeClass:i}=n(this._measuredWidth,this._props);this._child.width=t;let a=r(this._child.className,i);this._child.className!==a&&(this._child.className=a)}};export{AdwClamp,e as DEFAULT_CLAMP_MAX_SIZE,t as DEFAULT_CLAMP_TIGHTENING_THRESHOLD};
1
+ import"../_virtual/_rolldown/runtime.js";import{DEFAULT_CLAMP_MAX_SIZE as e,DEFAULT_CLAMP_TIGHTENING_THRESHOLD as t,clampAllocationFor as n,clampChildClassName as r,defaultClampProps as i,normalizeClampProp as a}from"./chrome.js";import{GridLayout as o,ItemSpec as s}from"@nativescript/core";var AdwClamp=class extends o{_props=i();_child=null;_measuredWidth=0;constructor(){super(),this.className=`adw-clamp`,this.addColumn(new s(1,`star`)),this.addRow(new s(1,`auto`)),this.addEventListener(`layoutChanged`,()=>this._allocate())}setChild(e){this._child&&=(this._child.className=r(this._child.className,null),this.removeChild(this._child),null),e&&(e.horizontalAlignment=`center`,o.setColumn(e,0),o.setRow(e,0),this.addChild(e),this._child=e,this._allocate())}get child(){return this._child}_addChildFromBuilder(e,t){this.setChild(t)}get maximumSize(){return this._props.maximumSize}set maximumSize(t){this._props.maximumSize=a(t,e),this._allocate()}get tighteningThreshold(){return this._props.tighteningThreshold}set tighteningThreshold(e){this._props.tighteningThreshold=a(e,t),this._allocate()}_allocate(){let e=this.getActualSize?.();if(e&&e.width>0&&(this._measuredWidth=e.width),!this._child)return;let{width:t,sizeClass:i}=n(this._measuredWidth,this._props);this._child.width=t;let a=r(this._child.className,i);this._child.className!==a&&(this._child.className=a)}};export{AdwClamp,e as DEFAULT_CLAMP_MAX_SIZE,t as DEFAULT_CLAMP_TIGHTENING_THRESHOLD};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{Label as r,StackLayout as i,action as a}from"@nativescript/core";import{ComboState as o,ComboState as s}from"@gjsify/adwaita-core";import{panDownSymbolic as c}from"@gjsify/adwaita-icons/ui";const l=`notify::selected`;var AdwComboRow=class extends e{_valueLabel;_chevron;_state=new s;constructor(){super(),this.className=`adw-row adw-action-row adw-combo-row`;let e=new i;e.orientation=`horizontal`,e.className=`adw-combo-suffix`;let a=new r;a.className=`adw-combo-value`,a.text=``;let o=new t;o.className=`adw-combo-chevron`,o.iconColor=`#9a9a9a`,o.iconSize=16,o.icon=c,e.addChild(a),e.addChild(o),this.setSuffix(e),this._valueLabel=a,this._chevron=o,this._state.subscribe(e=>{if(this._valueLabel.text=e.label,this._syncChooser(),e.interactive){let t={eventName:l,object:this,selected:e.selected,value:e.value};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),n(this),this._syncChooser()}_syncChooser(){this._chevron.visibility=this._state.presentsChooser?`visible`:`collapse`}async _openChooser(){if(!this._state.presentsChooser)return;let e=this._state.options.map(e=>e.label),t=await a({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get options(){return this._state.options}set options(e){this._state.setOptions(e)}get selectedIndex(){return this._state.selectedIndex}set selectedIndex(e){this._state.setSelectedIndex(e)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}};export{AdwComboRow,o as ComboState,l as NOTIFY_SELECTED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwActionRow as t}from"./adw-action-row.js";import{AdwIcon as n}from"./adw-icon.js";import{attachRowPressFeedback as r}from"./row-press.js";import{Label as i,StackLayout as a,action as o}from"@nativescript/core";import{ComboState as s,ComboState as c}from"@gjsify/adwaita-core";import{panDownSymbolic as l}from"@gjsify/adwaita-icons/ui";const u=`notify::selected`;var AdwComboRow=class extends t{_valueLabel;_chevron;_state=new c;constructor(){super(),this.className=`adw-row adw-action-row adw-combo-row`;let e=new a;e.orientation=`horizontal`,e.className=`adw-combo-suffix`;let t=new i;t.className=`adw-combo-value`,t.text=``;let o=new n;o.className=`adw-combo-chevron`,o.iconColor=`#9a9a9a`,o.iconSize=16,o.icon=l,e.addChild(t),e.addChild(o),this.setSuffix(e),this._valueLabel=t,this._chevron=o,this._state.subscribe(e=>{if(this._valueLabel.text=e.label,this._syncChooser(),e.interactive){let t={eventName:u,object:this,selected:e.selected,value:e.value};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),r(this),this._syncChooser()}_syncChooser(){this._chevron.visibility=this._state.presentsChooser?`visible`:`collapse`}async _openChooser(){if(!this._state.presentsChooser)return;let e=this._state.options.map(e=>e.label),t=await o({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get options(){return this._state.options}set options(e){this._state.setOptions(e)}get selectedIndex(){return this._state.selectedIndex}set selectedIndex(t){let n=e(t,this.selectedIndex);this._state.setSelectedIndex(n)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}};export{AdwComboRow,s as ComboState,u as NOTIFY_SELECTED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{attachRowPressFeedback as e}from"./row-press.js";import{DATA_GRID_HEADER_CELL_CLASS as t,DATA_GRID_HEADER_ROW_CLASS as n,DATA_GRID_SECTION_CELL_CLASS as r,dataGridCellClass as i,dataGridItemSpec as a,dataGridRowClass as o,dataGridShapeKey as s,dataGridTracksKey as c}from"./data-grid-model.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";import{dataGridCellText as p,dataGridColumnClasses as m,dataGridRowInteractive as h,dataGridTracks as g,normalizeDataGridColumns as _,normalizeDataGridVariant as v}from"@gjsify/adwaita-core";const y=`row-activated`;var AdwDataGrid=class extends l{_columns=[];_rows=[];_interactive=!1;_header=null;_rowNodes=[];_trackKey=``;_shapeKey=``;constructor(){super(),this.className=`adw-data-grid`}get columns(){return this._columns}set columns(e){this._columns=_(e),this._render()}get rows(){return this._rows}set rows(e){this._rows=Array.isArray(e)?e.map(e=>({...e})):[],this._render()}get interactive(){return this._interactive}set interactive(e){this._interactive=!!e,this._paint()}_render(){this._syncColumns(),this._syncNodes(),this._paint()}_syncColumns(){let e=g(this._columns),t=c(e);if(t!==this._trackKey){this._trackKey=t,this.removeColumns();for(let t of e){let e=a(t);this.addColumn(new u(e.value,e.type))}}}_syncNodes(){let e=this._columns.length,t=s(e,this._rows.length);if(t!==this._shapeKey){this._shapeKey=t;for(let e of[this._header,...this._rowNodes])if(e!==null){this.removeChild(e.background);for(let t of e.cells)this.removeChild(t)}this._header=null,this._rowNodes=[],this.removeRows(),e!==0&&(this.addRow(new u(1,`auto`)),this._header=this._buildRow(0,e,!1),this._rowNodes=this._rows.map((t,n)=>(this.addRow(new u(1,`auto`)),this._buildRow(n+1,e,!0))))}}_buildRow(t,n,r){let i=new f;l.setRow(i,t),l.setColumn(i,0),l.setColumnSpan(i,n),this.addChild(i),r&&(e(i),i.addEventListener(`tap`,()=>this._activate(t-1)));let a=[];for(let e=0;e<n;e++){let n=new d;n.textWrap=!1,l.setRow(n,t),l.setColumn(n,e),this.addChild(n),a.push(n)}return{background:i,cells:a}}_paint(){let e=this._header;e!==null&&(e.background.className=n,this._columns.forEach((n,r)=>{let i=e.cells[r];i!==void 0&&(i.className=`${m(n).join(` `)} ${t}`,i.text=n.label??n.key,this._showCell(i,1))}),this._rows.forEach((e,t)=>{let n=this._rowNodes[t];if(n===void 0)return;let a=v(e.variant),s=h(a,e.interactive,this._interactive);if(n.background.className=o(a,s),a===`section`){let t=this._columns[0]?.key??``;n.cells.forEach((n,i)=>{i===0?(n.className=r,n.text=p(e[t]),this._showCell(n,this._columns.length)):(n.text=``,n.visibility=`collapse`,l.setColumnSpan(n,1))});return}this._columns.forEach((t,r)=>{let o=n.cells[r];o!==void 0&&(o.className=i(m(t),a),o.text=p(e[t.key]),this._showCell(o,1))})}))}_showCell(e,t){e.visibility=`visible`,l.setColumnSpan(e,t)}_activate(e){let t=this._rows[e];if(t===void 0||!h(v(t.variant),t.interactive,this._interactive))return;let n={eventName:y,object:this,index:e,row:t};this.notify(n)}};export{AdwDataGrid,y as ROW_ACTIVATED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{attachRowPressFeedback as t}from"./row-press.js";import{DATA_GRID_HEADER_CELL_CLASS as n,DATA_GRID_HEADER_ROW_CLASS as r,DATA_GRID_SECTION_CELL_CLASS as i,dataGridCellClass as a,dataGridItemSpec as o,dataGridRowClass as s,dataGridShapeKey as c,dataGridTracksKey as l}from"./data-grid-model.js";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p}from"@nativescript/core";import{dataGridCellText as m,dataGridColumnClasses as h,dataGridRowInteractive as g,dataGridTracks as _,normalizeDataGridColumns as v,normalizeDataGridVariant as y}from"@gjsify/adwaita-core";const b=`row-activated`;var AdwDataGrid=class extends u{_columns=[];_rows=[];_interactive=!1;_header=null;_rowNodes=[];_trackKey=``;_shapeKey=``;constructor(){super(),this.className=`adw-data-grid`}get columns(){return this._columns}set columns(e){this._columns=v(e),this._render()}get rows(){return this._rows}set rows(e){this._rows=Array.isArray(e)?e.map(e=>({...e})):[],this._render()}get interactive(){return this._interactive}set interactive(t){let n=e(t,this.interactive);this._interactive=!!n,this._paint()}_render(){this._syncColumns(),this._syncNodes(),this._paint()}_syncColumns(){let e=_(this._columns),t=l(e);if(t!==this._trackKey){this._trackKey=t,this.removeColumns();for(let t of e){let e=o(t);this.addColumn(new d(e.value,e.type))}}}_syncNodes(){let e=this._columns.length,t=c(e,this._rows.length);if(t!==this._shapeKey){this._shapeKey=t;for(let e of[this._header,...this._rowNodes])if(e!==null){this.removeChild(e.background);for(let t of e.cells)this.removeChild(t)}this._header=null,this._rowNodes=[],this.removeRows(),e!==0&&(this.addRow(new d(1,`auto`)),this._header=this._buildRow(0,e,!1),this._rowNodes=this._rows.map((t,n)=>(this.addRow(new d(1,`auto`)),this._buildRow(n+1,e,!0))))}}_buildRow(e,n,r){let i=new p;u.setRow(i,e),u.setColumn(i,0),u.setColumnSpan(i,n),this.addChild(i),r&&(t(i),i.addEventListener(`tap`,()=>this._activate(e-1)));let a=[];for(let t=0;t<n;t++){let n=new f;n.textWrap=!1,u.setRow(n,e),u.setColumn(n,t),this.addChild(n),a.push(n)}return{background:i,cells:a}}_paint(){let e=this._header;e!==null&&(e.background.className=r,this._columns.forEach((t,r)=>{let i=e.cells[r];i!==void 0&&(i.className=`${h(t).join(` `)} ${n}`,i.text=t.label??t.key,this._showCell(i,1))}),this._rows.forEach((e,t)=>{let n=this._rowNodes[t];if(n===void 0)return;let r=y(e.variant),o=g(r,e.interactive,this._interactive);if(n.background.className=s(r,o),r===`section`){let t=this._columns[0]?.key??``;n.cells.forEach((n,r)=>{r===0?(n.className=i,n.text=m(e[t]),this._showCell(n,this._columns.length)):(n.text=``,n.visibility=`collapse`,u.setColumnSpan(n,1))});return}this._columns.forEach((t,i)=>{let o=n.cells[i];o!==void 0&&(o.className=a(h(t),r),o.text=m(e[t.key]),this._showCell(o,1))})}))}_showCell(e,t){e.visibility=`visible`,u.setColumnSpan(e,t)}_activate(e){let t=this._rows[e];if(t===void 0||!g(y(t.variant),t.interactive,this._interactive))return;let n={eventName:b,object:this,index:e,row:t};this.notify(n)}};export{AdwDataGrid,b as ROW_ACTIVATED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{attachRowPressFeedback as t}from"./row-press.js";import{Label as n,StackLayout as r,action as i}from"@nativescript/core";import{ComboState as a}from"@gjsify/adwaita-core";import{panDownSymbolic as o}from"@gjsify/adwaita-icons/ui";const s=`notify::selected`;var AdwDropDown=class extends r{_label;_chevron;_state=new a;_chooserTitle=``;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let r=new n;r.className=`adw-drop-down-label`,r.text=``;let i=new e;i.className=`adw-drop-down-chevron`,i.icon=o,this.addChild(r),this.addChild(i),this._label=r,this._chevron=i,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive){let t={eventName:s,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),t(this)}async _openChooser(){if(this._state.count===0)return;let e=this._state.options.map(e=>e.label),t=await i({title:this._chooserTitle||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get options(){return this._state.options}set options(e){this._state.setOptions(e)}get selected(){return this._state.selectedIndex}set selected(e){this._state.setSelectedIndex(e)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.options[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{AdwDropDown,s as NOTIFY_SELECTED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{Label as r,StackLayout as i,action as a}from"@nativescript/core";import{ComboState as o}from"@gjsify/adwaita-core";import{panDownSymbolic as s}from"@gjsify/adwaita-icons/ui";const c=`notify::selected`;var AdwDropDown=class extends i{_label;_chevron;_state=new o;_chooserTitle=``;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let e=new r;e.className=`adw-drop-down-label`,e.text=``;let i=new t;i.className=`adw-drop-down-chevron`,i.icon=s,this.addChild(e),this.addChild(i),this._label=e,this._chevron=i,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive){let t={eventName:c,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),n(this)}async _openChooser(){if(this._state.count===0)return;let e=this._state.options.map(e=>e.label),t=await a({title:this._chooserTitle||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get options(){return this._state.options}set options(e){this._state.setOptions(e)}get selected(){return this._state.selectedIndex}set selected(t){let n=e(t,this.selected);this._state.setSelectedIndex(n)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.options[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{AdwDropDown,c as NOTIFY_SELECTED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwIcon as t}from"./adw-icon.js";import{AdwImageButton as n}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as r,NS_ENTRY_ROW_CLASS as i,applyEntryRowState as a}from"./entry-row-view.js";import{Label as o,StackLayout as s,TextField as c}from"@nativescript/core";import{ADW_ACCENT_FG_COLOR as l,EntryRowState as u,EntryRowState as d}from"@gjsify/adwaita-core";import{documentEditSymbolic as f,objectSelectSymbolic as p}from"@gjsify/adwaita-icons/actions";const m=`notify::text`,h=`notify::text-length`,g=`apply`,_=`entry-activated`;var AdwEntryRow=class extends e{isActionRow=!1;_state=new d;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;_lastText=``;_lastLength=0;constructor(){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,this._managesTitleVisibility=!1;let e=new o;e.className=`adw-row-title adw-entry-empty-title`,e.textWrap=!0,this._textStack.insertChild(e,0),this._emptyTitle=e;let i=new c;i.className=`adw-entry-field`,i.set(`backgroundColor`,`transparent`),i.set(`borderWidth`,0),this._textStack.addChild(i),this._field=i;let a=new s;a.orientation=`horizontal`,a.className=`adw-entry-row-suffixes`,this._suffixes=a;let u=new t;u.className=`adw-icon adw-entry-indicator`,a.addChild(u),this._indicator=u;let d=new n;d.className=`${d.className} adw-entry-apply`.trim(),d.icon=p,d.iconColor=l,d.addEventListener(`tap`,()=>this.apply()),a.addChild(d),this._applyButton=d;let m=new t;m.className=r,m.icon=f,a.addChild(m),this._editIcon=m,super.setSuffix(a),this._field.addEventListener(`textChange`,()=>{this._state.setText(this._field.text??``)}),this._field.addEventListener(`focus`,()=>this._state.setEditing(!0)),this._field.addEventListener(`blur`,()=>this._state.setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this._lastText=this._state.text,this._lastLength=this._state.textLength,this._render(this._state.state),this._state.subscribe(e=>this._onStateChanged(e))}get text(){return this._state.text}set text(e){this._state.setText(e??``)}get textLength(){return this._state.textLength}get maxLength(){return this._state.maxLength}set maxLength(e){this._state.setMaxLength(e)}get editable(){return this._state.editable}set editable(e){this._state.setEditable(e)}get showApplyButton(){return this._state.showApplyButton}set showApplyButton(e){this._state.setShowApplyButton(e)}get activatesDefault(){return this._state.activatesDefault}set activatesDefault(e){this._state.setActivatesDefault(e)}get editing(){return this._state.editing}addSuffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e)}setSuffix(e){this._slotSuffix&&=(this._suffixes.removeChild(this._slotSuffix),null),e&&(this.addSuffix(e),this._slotSuffix=e)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._state.setShowIndicator(e)}setIndicatorIcon(e){this._indicator.icon=e}apply(){this._state.apply(),this.notify({eventName:g,object:this})}_activate(){let e=this._state.activate();if(e.signal===`apply`){this.notify({eventName:g,object:this});return}let t={eventName:_,object:this,activateDefault:e.activateDefault};this.notify(t)}_render(e){a({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return i}_onStateChanged(e){if(this._render(e),e.text!==this._lastText){this._lastText=e.text;let t={eventName:m,object:this,text:e.text};this.notify(t)}if(e.textLength!==this._lastLength){this._lastLength=e.textLength;let t={eventName:h,object:this,textLength:e.textLength};this.notify(t)}}};export{AdwEntryRow,u as EntryRowState,m as NOTIFY_TEXT,h as NOTIFY_TEXT_LENGTH,g as SIGNAL_APPLY,_ as SIGNAL_ENTRY_ACTIVATED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{AdwActionRow as n}from"./adw-action-row.js";import{AdwIcon as r}from"./adw-icon.js";import{AdwImageButton as i}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as a,NS_ENTRY_ROW_CLASS as o,applyEntryRowState as s}from"./entry-row-view.js";import{Label as c,StackLayout as l,TextField as u}from"@nativescript/core";import{ADW_ACCENT_FG_COLOR as d,EntryRowState as f,EntryRowState as p}from"@gjsify/adwaita-core";import{documentEditSymbolic as m,objectSelectSymbolic as h}from"@gjsify/adwaita-icons/actions";const g=`notify::text`,_=`notify::text-length`,v=`apply`,y=`entry-activated`;var AdwEntryRow=class extends n{isActionRow=!1;_state=new p;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;_lastText=``;_lastLength=0;constructor(){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,this._managesTitleVisibility=!1;let e=new c;e.className=`adw-row-title adw-entry-empty-title`,e.textWrap=!0,this._textStack.insertChild(e,0),this._emptyTitle=e;let t=new u;t.className=`adw-entry-field`,t.set(`backgroundColor`,`transparent`),t.set(`borderWidth`,0),this._textStack.addChild(t),this._field=t;let n=new l;n.orientation=`horizontal`,n.className=`adw-entry-row-suffixes`,this._suffixes=n;let o=new r;o.className=`adw-icon adw-entry-indicator`,n.addChild(o),this._indicator=o;let s=new i;s.className=`${s.className} adw-entry-apply`.trim(),s.icon=h,s.iconColor=d,s.addEventListener(`tap`,()=>this.apply()),n.addChild(s),this._applyButton=s;let f=new r;f.className=a,f.icon=m,n.addChild(f),this._editIcon=f,super.setSuffix(n),this._field.addEventListener(`textChange`,()=>{this._state.setText(this._field.text??``)}),this._field.addEventListener(`focus`,()=>this._state.setEditing(!0)),this._field.addEventListener(`blur`,()=>this._state.setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this._lastText=this._state.text,this._lastLength=this._state.textLength,this._render(this._state.state),this._state.subscribe(e=>this._onStateChanged(e))}get text(){return this._state.text}set text(e){this._state.setText(e??``)}get textLength(){return this._state.textLength}get maxLength(){return this._state.maxLength}set maxLength(e){let n=t(e,this.maxLength);this._state.setMaxLength(n)}get editable(){return this._state.editable}set editable(t){let n=e(t,this.editable);this._state.setEditable(n)}get showApplyButton(){return this._state.showApplyButton}set showApplyButton(t){let n=e(t,this.showApplyButton);this._state.setShowApplyButton(n)}get activatesDefault(){return this._state.activatesDefault}set activatesDefault(t){let n=e(t,this.activatesDefault);this._state.setActivatesDefault(n)}get editing(){return this._state.editing}addSuffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e)}setSuffix(e){this._slotSuffix&&=(this._suffixes.removeChild(this._slotSuffix),null),e&&(this.addSuffix(e),this._slotSuffix=e)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._state.setShowIndicator(e)}setIndicatorIcon(e){this._indicator.icon=e}apply(){this._state.apply(),this.notify({eventName:v,object:this})}_activate(){let e=this._state.activate();if(e.signal===`apply`){this.notify({eventName:v,object:this});return}let t={eventName:y,object:this,activateDefault:e.activateDefault};this.notify(t)}_render(e){s({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return o}_onStateChanged(e){if(this._render(e),e.text!==this._lastText){this._lastText=e.text;let t={eventName:g,object:this,text:e.text};this.notify(t)}if(e.textLength!==this._lastLength){this._lastLength=e.textLength;let t={eventName:_,object:this,textLength:e.textLength};this.notify(t)}}};export{AdwEntryRow,f as EntryRowState,g as NOTIFY_TEXT,_ as NOTIFY_TEXT_LENGTH,v as SIGNAL_APPLY,y as SIGNAL_ENTRY_ACTIVATED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t,TextField as n}from"@nativescript/core";import{ENTRY_ROW_MAX_LENGTH_LIMIT as r,clampEntryText as i,entryTextLength as a}from"@gjsify/adwaita-core";const o=`notify::text`,s=`activate`;var AdwEntry=class extends e{_field;_text=``;_maxLength=0;constructor(){super(),this.className=`adw-entry`,this.addColumn(new t(1,`star`)),this.addRow(new t(1,`auto`));let e=new n;e.className=`adw-entry-input`,e.set(`backgroundColor`,`transparent`),e.set(`borderWidth`,0),this.addChild(e),this._field=e,e.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),e.addEventListener(`returnPress`,()=>{let e={eventName:s,object:this};this.notify(e)})}_applyText(e){let t=i(e,this._maxLength);if(this._field.text!==t&&(this._field.text=t),t===this._text)return;this._text=t;let n={eventName:o,object:this,text:t,textLength:a(t)};this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return a(this._text)}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=Number.isFinite(e)?Math.min(r,Math.max(0,Math.trunc(e))):0,this._applyText(this._text)}get placeholder(){return this._field.hint??``}set placeholder(e){this._field.hint=e??``}get editable(){return this._field.editable}set editable(e){this._field.editable=!!e}get field(){return this._field}};export{s as ACTIVATE,AdwEntry,o as NOTIFY_TEXT};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{GridLayout as n,ItemSpec as r,TextField as i}from"@nativescript/core";import{ENTRY_ROW_MAX_LENGTH_LIMIT as a,clampEntryText as o,entryTextLength as s}from"@gjsify/adwaita-core";const c=`notify::text`,l=`activate`;var AdwEntry=class extends n{_field;_text=``;_maxLength=0;constructor(){super(),this.className=`adw-entry`,this.addColumn(new r(1,`star`)),this.addRow(new r(1,`auto`));let e=new i;e.className=`adw-entry-input`,e.set(`backgroundColor`,`transparent`),e.set(`borderWidth`,0),this.addChild(e),this._field=e,e.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),e.addEventListener(`returnPress`,()=>{let e={eventName:l,object:this};this.notify(e)})}_applyText(e){let t=o(e,this._maxLength);if(this._field.text!==t&&(this._field.text=t),t===this._text)return;this._text=t;let n={eventName:c,object:this,text:t,textLength:s(t)};this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return s(this._text)}get maxLength(){return this._maxLength}set maxLength(e){let n=t(e,this.maxLength);this._maxLength=Number.isFinite(n)?Math.min(a,Math.max(0,Math.trunc(n))):0,this._applyText(this._text)}get placeholder(){return this._field.hint??``}set placeholder(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{l as ACTIVATE,AdwEntry,c as NOTIFY_TEXT};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwIcon as t}from"./adw-icon.js";import{GridLayout as n,ItemSpec as r,StackLayout as i}from"@nativescript/core";import{ExpanderState as a,ExpanderState as o}from"@gjsify/adwaita-core";import{panDownSymbolic as s,panUpSymbolic as c}from"@gjsify/adwaita-icons/ui";const l=`notify::expanded`;var AdwExpanderRow=class extends e{isActionRow=!1;_toggle;_disclosure;_state=new o;constructor(){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new r(1,`auto`));let e=new i;e.orientation=`vertical`,e.className=`adw-expander-disclosure`,e.visibility=`collapse`,n.setRow(e,1),n.setColumn(e,0),n.setColumnSpan(e,3),this.addChild(e),this._disclosure=e;let a=new t;a.icon=s,a.className=`${a.className} adw-expander-toggle`.trim(),this.setSuffix(a),this._toggle=a,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.icon=e?c:s;let t={eventName:l,object:this,expanded:e};this.notify(t)});let toggleOnTap=()=>{this._state.toggle()};this._textStack.addEventListener(`tap`,toggleOnTap),a.addEventListener(`tap`,toggleOnTap)}addRow(e){if(e instanceof r){super.addRow(e);return}this._disclosure.addChild(e)}removeRow(e){this._disclosure.removeChild(e)}get expanded(){return this._state.expanded}set expanded(e){this._state.setExpanded(e)}};export{AdwExpanderRow,a as ExpanderState,l as NOTIFY_EXPANDED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{resolveBuilderSlot as t}from"./builder-slots.js";import{AdwActionRow as n}from"./adw-action-row.js";import{AdwIcon as r}from"./adw-icon.js";import{GridLayout as i,ItemSpec as a,StackLayout as o}from"@nativescript/core";import{ExpanderState as s,ExpanderState as c}from"@gjsify/adwaita-core";import{panDownSymbolic as l,panUpSymbolic as u}from"@gjsify/adwaita-icons/ui";const d=`notify::expanded`,f=[`prefix`,`suffix`];var AdwExpanderRow=class extends n{isActionRow=!1;_toggle;_disclosure;_state=new c;constructor(){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new a(1,`auto`));let e=new o;e.orientation=`vertical`,e.className=`adw-expander-disclosure`,e.visibility=`collapse`,i.setRow(e,1),i.setColumn(e,0),i.setColumnSpan(e,3),this.addChild(e),this._disclosure=e;let t=new r;t.icon=l,t.className=`${t.className} adw-expander-toggle`.trim(),this.setSuffix(t),this._toggle=t,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.icon=e?u:l;let t={eventName:d,object:this,expanded:e};this.notify(t)});let toggleOnTap=()=>{this._state.toggle()};this._textStack.addEventListener(`tap`,toggleOnTap),t.addEventListener(`tap`,toggleOnTap)}addRow(e){if(e instanceof a){super.addRow(e);return}this._disclosure.addChild(e)}removeRow(e){this._disclosure.removeChild(e)}_addChildFromBuilder(e,n){let r=t(e,f,`row`);r===`row`?this.addRow(n):super._addChildFromBuilder(r,n)}get disclosureRows(){let e=[];for(let t=0;t<this._disclosure.getChildrenCount();t++)e.push(this._disclosure.getChildAt(t));return e}get expanded(){return this._state.expanded}set expanded(t){this._state.setExpanded(e(t,!1))}};export{AdwExpanderRow,s as ExpanderState,d as NOTIFY_EXPANDED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwWindowTitle as e}from"./adw-window-title.js";import{GridLayout as t,ItemSpec as n,StackLayout as r}from"@nativescript/core";var AdwHeaderBar=class extends t{_startBox;_endBox;_titleWidget;_flat=!1;constructor(){super(),this.className=`adw-header-bar`,this.addColumn(new n(1,`auto`)),this.addColumn(new n(1,`star`)),this.addColumn(new n(1,`auto`)),this.addRow(new n(1,`auto`));let i=new r;i.orientation=`horizontal`,i.className=`adw-header-bar-start`,t.setColumn(i,0),this.addChild(i),this._startBox=i;let a=new e;a.horizontalAlignment=`center`,a.verticalAlignment=`middle`,t.setColumn(a,1),this.addChild(a),this._titleWidget=a;let o=new r;o.orientation=`horizontal`,o.className=`adw-header-bar-end`,o.horizontalAlignment=`right`,t.setColumn(o,2),this.addChild(o),this._endBox=o}get title(){return this._titleWidget instanceof e?this._titleWidget.title:``}set title(t){this._titleWidget instanceof e&&(this._titleWidget.title=t??``)}get subtitle(){return this._titleWidget instanceof e?this._titleWidget.subtitle:``}set subtitle(t){this._titleWidget instanceof e&&(this._titleWidget.subtitle=t??``)}get flat(){return this._flat}set flat(e){this._flat=!!e,this.className=this._flat?`adw-header-bar flat`:`adw-header-bar`}packStart(e){this._startBox.addChild(e)}packEnd(e){this._endBox.insertChild(e,0)}setTitleWidget(e){this._titleWidget&&this.removeChild(this._titleWidget),e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,t.setColumn(e,1),this.addChild(e),this._titleWidget=e}get titleWidget(){return this._titleWidget}get startBox(){return this._startBox}get endBox(){return this._endBox}};export{AdwHeaderBar};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{resolveBuilderSlot as t}from"./builder-slots.js";import{AdwWindowTitle as n}from"./adw-window-title.js";import{GridLayout as r,ItemSpec as i,StackLayout as a}from"@nativescript/core";const o=[`titleWidget`,`startBox`,`endBox`];var AdwHeaderBar=class extends r{_startBox;_endBox;_titleWidget;_flat=!1;constructor(){super(),this.className=`adw-header-bar`,this.addColumn(new i(1,`auto`)),this.addColumn(new i(1,`star`)),this.addColumn(new i(1,`auto`)),this.addRow(new i(1,`auto`));let e=new a;e.orientation=`horizontal`,e.className=`adw-header-bar-start`,r.setColumn(e,0),this.addChild(e),this._startBox=e;let t=new n;t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,r.setColumn(t,1),this.addChild(t),this._titleWidget=t;let o=new a;o.orientation=`horizontal`,o.className=`adw-header-bar-end`,o.horizontalAlignment=`right`,r.setColumn(o,2),this.addChild(o),this._endBox=o}get title(){return this._titleWidget instanceof n?this._titleWidget.title:``}set title(e){this._titleWidget instanceof n&&(this._titleWidget.title=e??``)}get subtitle(){return this._titleWidget instanceof n?this._titleWidget.subtitle:``}set subtitle(e){this._titleWidget instanceof n&&(this._titleWidget.subtitle=e??``)}get flat(){return this._flat}set flat(t){let n=e(t,this.flat);this._flat=!!n,this.className=this._flat?`adw-header-bar flat`:`adw-header-bar`}packStart(e){this._startBox.addChild(e)}packEnd(e){this._endBox.insertChild(e,0)}setTitleWidget(e){this._titleWidget&&this.removeChild(this._titleWidget),e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,r.setColumn(e,1),this.addChild(e),this._titleWidget=e}_addChildFromBuilder(e,n){switch(t(e,o,`startBox`)){case`titleWidget`:this.setTitleWidget(n);return;case`endBox`:this.packEnd(n);return;default:this.packStart(n)}}get titleWidget(){return this._titleWidget}get startBox(){return this._startBox}get endBox(){return this._endBox}};export{AdwHeaderBar};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{onAdwaitaColorSchemeChanged as e,themeIconColor as t}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as n}from"./icon-path.js";import{renderSymbolicIcon as r}from"./icons.js";import{Image as i}from"@nativescript/core";const a=16;var AdwIcon=class extends i{_iconSvg=``;_iconColor=t();_explicitColor=!1;_iconSize=16;_unsubScheme=null;constructor(){super(),this.className=`adw-icon`,this.stretch=`aspectFit`,this.width=this._iconSize,this.height=this._iconSize,this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=e(()=>this._syncThemeColor())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null})}_syncThemeColor(){if(this._explicitColor)return;let e=t();e!==this._iconColor&&(this._iconColor=e,this._render())}_render(){if(!this._iconSvg)return;let e=r(this._iconSvg,{size:this._iconSize,color:this._iconColor});e&&(this.imageSource=e)}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._render()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||n,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=Number.isFinite(e)&&e>0?e:16,this.width=this._iconSize,this.height=this._iconSize,this._render()}};export{AdwIcon,a as DEFAULT_ADW_ICON_SIZE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{onAdwaitaColorSchemeChanged as t,themeIconColor as n}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as r}from"./icon-path.js";import{renderSymbolicIcon as i}from"./icons.js";import{Image as a}from"@nativescript/core";const o=16;var AdwIcon=class extends a{_iconSvg=``;_iconColor=n();_explicitColor=!1;_iconSize=16;_unsubScheme=null;constructor(){super(),this.className=`adw-icon`,this.stretch=`aspectFit`,this.width=this._iconSize,this.height=this._iconSize,this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=t(()=>this._syncThemeColor())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null})}_syncThemeColor(){if(this._explicitColor)return;let e=n();e!==this._iconColor&&(this._iconColor=e,this._render())}_render(){if(!this._iconSvg)return;let e=i(this._iconSvg,{size:this._iconSize,color:this._iconColor});e&&(this.imageSource=e)}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._render()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||r,this._render()}get iconSize(){return this._iconSize}set iconSize(t){let n=e(t,this.iconSize);this._iconSize=Number.isFinite(n)&&n>0?n:16,this.width=this._iconSize,this.height=this._iconSize,this._render()}};export{AdwIcon,o as DEFAULT_ADW_ICON_SIZE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{onAdwaitaColorSchemeChanged as e,themeIconColor as t}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as n}from"./icon-path.js";import{renderSymbolicIcon as r}from"./icons.js";import{attachRowPressFeedback as i}from"./row-press.js";import{GridLayout as a,Image as o,ItemSpec as s}from"@nativescript/core";const c=16;var AdwImageButton=class extends a{_image;_iconSvg=``;_iconColor=t();_explicitColor=!1;_iconSize=16;_unsubScheme=null;constructor(){super(),this.className=`adw-image-button`,this.addRow(new s(1,`star`)),this.addColumn(new s(1,`star`));let t=new o;t.className=`adw-image-button-icon`,t.stretch=`aspectFit`,t.width=this._iconSize,t.height=this._iconSize,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,this.addChild(t),this._image=t,i(this),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=e(()=>this._syncThemeColor())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null})}_syncThemeColor(){if(this._explicitColor)return;let e=t();e!==this._iconColor&&(this._iconColor=e,this._render())}_render(){if(!this._iconSvg)return;let e=r(this._iconSvg,{size:this._iconSize,color:this._iconColor});e&&(this._image.imageSource=e)}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._image.width=this._iconSize,this._image.height=this._iconSize,this._render()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||n,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=Number.isFinite(e)&&e>0?e:16,this._image.width=this._iconSize,this._image.height=this._iconSize,this._render()}get image(){return this._image}};export{AdwImageButton,c as DEFAULT_ICON_BUTTON_ICON_SIZE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{onAdwaitaColorSchemeChanged as t,themeIconColor as n}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as r}from"./icon-path.js";import{renderSymbolicIcon as i}from"./icons.js";import{attachRowPressFeedback as a}from"./row-press.js";import{GridLayout as o,Image as s,ItemSpec as c}from"@nativescript/core";const l=16;var AdwImageButton=class extends o{_image;_iconSvg=``;_iconColor=n();_explicitColor=!1;_iconSize=16;_unsubScheme=null;constructor(){super(),this.className=`adw-image-button`,this.addRow(new c(1,`star`)),this.addColumn(new c(1,`star`));let e=new s;e.className=`adw-image-button-icon`,e.stretch=`aspectFit`,e.width=this._iconSize,e.height=this._iconSize,e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,this.addChild(e),this._image=e,a(this),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=t(()=>this._syncThemeColor())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null})}_syncThemeColor(){if(this._explicitColor)return;let e=n();e!==this._iconColor&&(this._iconColor=e,this._render())}_render(){if(!this._iconSvg)return;let e=i(this._iconSvg,{size:this._iconSize,color:this._iconColor});e&&(this._image.imageSource=e)}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._image.width=this._iconSize,this._image.height=this._iconSize,this._render()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||r,this._render()}get iconSize(){return this._iconSize}set iconSize(t){let n=e(t,this.iconSize);this._iconSize=Number.isFinite(n)&&n>0?n:16,this._image.width=this._iconSize,this._image.height=this._iconSize,this._render()}get image(){return this._image}};export{AdwImageButton,l as DEFAULT_ICON_BUTTON_ICON_SIZE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{NsNavigationSplitViewState as e,splitViewColumns as t}from"./split-view-state.js";import{AdwSplitViewBase as n}from"./split-view-base.js";import{GridLayout as r}from"@nativescript/core";var i=class AdwNavigationSplitView extends n{constructor(){super(`adw-navigation-split-view`,`navigation`,new e({onCritical:e=>console.error(e),onDelegate:(e,t)=>{for(let n=this.parent;n;n=n.parent)if(n instanceof AdwNavigationSplitView)return(e===`push`?n.push(t):n.pop()).kind!==`not-found`;return!1}})),this._applyLayout()}_applyLayout(){if(!this._state.collapsed){let e=t(this._state.sidebarPosition,this.textDirection);this._sidebar&&(this._sidebar.visibility=`visible`,this._sidebar.translateX=0,r.setColumn(this._sidebar,e.sidebar),r.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth),this._content&&(this._content.visibility=`visible`,this._content.translateX=0,r.setColumn(this._content,e.content),r.setColumnSpan(this._content,1));return}let e=this._state.visiblePane;this._sidebar&&(this._sidebar.visibility=e===`sidebar`?`visible`:`collapse`,this._sidebar.translateX=0,r.setColumn(this._sidebar,0),r.setColumnSpan(this._sidebar,2),this._sidebar.width=`auto`),this._content&&(this._content.visibility=e===`content`?`visible`:`collapse`,this._content.translateX=0,r.setColumn(this._content,0),r.setColumnSpan(this._content,2))}_transitionSidebar(){if(!this._shouldAnimate()||!this._sidebar||!this._content){this._applyLayout();return}this._cancelPending();for(let e of[this._sidebar,this._content])r.setColumn(e,0),r.setColumnSpan(e,2);this._sidebar.width=`auto`;let e=this._paneWidth(),t=this._state.transition===`push`,n=this._state.visiblePane===`sidebar`?this._sidebar:this._content,i=n===this._sidebar?this._content:this._sidebar,a=t?e:-e,o=t?-e:e;n.visibility=`visible`,n.translateX=a,i.visibility=`visible`,i.translateX=0,this._track(n.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})),this._track(i.animate({translate:{x:o,y:0},duration:200,curve:`easeIn`})).then(()=>this._settleAfterSwap(n,i)).catch(()=>{})}_settleAfterSwap(e,t){(this._state.visiblePane===`sidebar`?this._sidebar:this._content)===e&&(t.visibility=`collapse`,t.translateX=0)}_paneWidth(){let e=this.getActualSize();return e&&e.width>0?e.width:1024}get sidebarTag(){return this._state.sidebarTag}set sidebarTag(e){this._state.setTag(`sidebar`,e)}get contentTag(){return this._state.contentTag}set contentTag(e){this._state.setTag(`content`,e)}push(e){return this._state.push(e)}pop(){return this._state.pop()}get showContent(){return this._state.showContent}set showContent(e){this._state.showContent=e}};export{i as AdwNavigationSplitView};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{NsNavigationSplitViewState as t,splitViewColumns as n}from"./split-view-state.js";import{AdwSplitViewBase as r}from"./split-view-base.js";import{GridLayout as i}from"@nativescript/core";var a=class AdwNavigationSplitView extends r{constructor(){super(`adw-navigation-split-view`,`navigation`,new t({onCritical:e=>console.error(e),onDelegate:(e,t)=>{for(let n=this.parent;n;n=n.parent)if(n instanceof AdwNavigationSplitView)return(e===`push`?n.push(t):n.pop()).kind!==`not-found`;return!1}})),this._applyLayout()}_applyLayout(){if(!this._state.collapsed){let e=n(this._state.sidebarPosition,this.textDirection);this._sidebar&&(this._sidebar.visibility=`visible`,this._sidebar.translateX=0,i.setColumn(this._sidebar,e.sidebar),i.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth),this._content&&(this._content.visibility=`visible`,this._content.translateX=0,i.setColumn(this._content,e.content),i.setColumnSpan(this._content,1));return}let e=this._state.visiblePane;this._sidebar&&(this._sidebar.visibility=e===`sidebar`?`visible`:`collapse`,this._sidebar.translateX=0,i.setColumn(this._sidebar,0),i.setColumnSpan(this._sidebar,2),this._sidebar.width=`auto`),this._content&&(this._content.visibility=e===`content`?`visible`:`collapse`,this._content.translateX=0,i.setColumn(this._content,0),i.setColumnSpan(this._content,2))}_transitionSidebar(){if(!this._shouldAnimate()||!this._sidebar||!this._content){this._applyLayout();return}this._cancelPending();for(let e of[this._sidebar,this._content])i.setColumn(e,0),i.setColumnSpan(e,2);this._sidebar.width=`auto`;let e=this._paneWidth(),t=this._state.transition===`push`,n=this._state.visiblePane===`sidebar`?this._sidebar:this._content,r=n===this._sidebar?this._content:this._sidebar,a=t?e:-e,o=t?-e:e;n.visibility=`visible`,n.translateX=a,r.visibility=`visible`,r.translateX=0,this._track(n.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})),this._track(r.animate({translate:{x:o,y:0},duration:200,curve:`easeIn`})).then(()=>this._settleAfterSwap(n,r)).catch(()=>{})}_settleAfterSwap(e,t){(this._state.visiblePane===`sidebar`?this._sidebar:this._content)===e&&(t.visibility=`collapse`,t.translateX=0)}_paneWidth(){let e=this.getActualSize();return e&&e.width>0?e.width:1024}get sidebarTag(){return this._state.sidebarTag}set sidebarTag(e){this._state.setTag(`sidebar`,e)}get contentTag(){return this._state.contentTag}set contentTag(e){this._state.setTag(`content`,e)}push(e){return this._state.push(e)}pop(){return this._state.pop()}get showContent(){return this._state.showContent}set showContent(t){let n=e(t,this.showContent);this._state.showContent=n}};export{a as AdwNavigationSplitView};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{NOTIFY_VISIBLE_PAGE as e,NsNavigationStack as t,POPPED as n,PUSHED as r,REPLACED as i,navigationPageClassName as a}from"./navigation-stack.js";import{GridLayout as o,ItemSpec as s}from"@nativescript/core";import{describeNavigationDiagnostic as c}from"@gjsify/adwaita-core";var AdwNavigationView=class extends o{_nav;constructor(){super(),this.className=`adw-navigation-view`,this.addColumn(new s(1,`star`)),this.addRow(new s(1,`star`)),this._nav=new t({attachPage:e=>{e.className=a(e.className),o.setColumn(e,0),o.setRow(e,0),this.addChild(e)},detachPage:e=>this.removeChild(e),setPageVisibility:(e,t)=>{e.visibility=t},emit:e=>this._emit(e)},{onDiagnostic:e=>console.warn(`[AdwNavigationView] ${c(e)}`)})}add(e,t=null,n={}){return this._nav.add(e,t,n)}removePage(e){return this._nav.remove(e)}push(e,t={}){return this._nav.push(e,t)}pushByTag(e){return this._nav.pushByTag(e)}pop(){return this._nav.pop()}popToPage(e){return this._nav.popToPage(e)}popToTag(e){return this._nav.popToTag(e)}replace(e){this._nav.replace(e)}replaceWithTags(e){this._nav.replaceWithTags(e)}findPage(e){return this._nav.findPage(e)}getPreviousPage(e){return this._nav.getPreviousPage(e)}setPageTag(e,t){return this._nav.setTag(e,t)}setPageTitle(e,t){return this._nav.setTitle(e,t)}setPageCanPop(e,t){return this._nav.setCanPop(e,t)}canGoBack(){return this._nav.canGoBack()}backButtonTooltip(e){return this._nav.backButtonTooltip(e)}popFromShortcut(){return this._nav.popFromShortcut()}popFromEscape(){return this._nav.popFromEscape()}get visiblePage(){return this._nav.visiblePage}get visiblePageTag(){return this._nav.visiblePageTag}get depth(){return this._nav.depth}get navigationStack(){return this._nav.stack}get pages(){return this._nav.pages}get animateTransitions(){return this._nav.animateTransitions}set animateTransitions(e){this._nav.setAnimateTransitions(e)}get popOnEscape(){return this._nav.popOnEscape}set popOnEscape(e){this._nav.setPopOnEscape(e)}_emit(e){let t={eventName:e.name,object:this,page:e.page,tag:e.tag,depth:e.depth};this.notify(t)}};export{AdwNavigationView,e as NOTIFY_VISIBLE_PAGE,n as POPPED,r as PUSHED,i as REPLACED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{NOTIFY_VISIBLE_PAGE as t,NsNavigationStack as n,POPPED as r,PUSHED as i,REPLACED as a,navigationPageClassName as o}from"./navigation-stack.js";import{GridLayout as s,ItemSpec as c}from"@nativescript/core";import{describeNavigationDiagnostic as l}from"@gjsify/adwaita-core";var AdwNavigationView=class extends s{_nav;constructor(){super(),this.className=`adw-navigation-view`,this.addColumn(new c(1,`star`)),this.addRow(new c(1,`star`)),this._nav=new n({attachPage:e=>{e.className=o(e.className),s.setColumn(e,0),s.setRow(e,0),this.addChild(e)},detachPage:e=>this.removeChild(e),setPageVisibility:(e,t)=>{e.visibility=t},emit:e=>this._emit(e)},{onDiagnostic:e=>console.warn(`[AdwNavigationView] ${l(e)}`)})}add(e,t=null,n={}){return this._nav.add(e,t,n)}_addChildFromBuilder(e,t){this.add(t)}removePage(e){return this._nav.remove(e)}push(e,t={}){return this._nav.push(e,t)}pushByTag(e){return this._nav.pushByTag(e)}pop(){return this._nav.pop()}popToPage(e){return this._nav.popToPage(e)}popToTag(e){return this._nav.popToTag(e)}replace(e){this._nav.replace(e)}replaceWithTags(e){this._nav.replaceWithTags(e)}findPage(e){return this._nav.findPage(e)}getPreviousPage(e){return this._nav.getPreviousPage(e)}setPageTag(e,t){return this._nav.setTag(e,t)}setPageTitle(e,t){return this._nav.setTitle(e,t)}setPageCanPop(e,t){return this._nav.setCanPop(e,t)}canGoBack(){return this._nav.canGoBack()}backButtonTooltip(e){return this._nav.backButtonTooltip(e)}popFromShortcut(){return this._nav.popFromShortcut()}popFromEscape(){return this._nav.popFromEscape()}get visiblePage(){return this._nav.visiblePage}get visiblePageTag(){return this._nav.visiblePageTag}get depth(){return this._nav.depth}get navigationStack(){return this._nav.stack}get pages(){return this._nav.pages}get animateTransitions(){return this._nav.animateTransitions}set animateTransitions(t){let n=e(t,this.animateTransitions);this._nav.setAnimateTransitions(n)}get popOnEscape(){return this._nav.popOnEscape}set popOnEscape(t){let n=e(t,this.popOnEscape);this._nav.setPopOnEscape(n)}_emit(e){let t={eventName:e.name,object:this,page:e.page,tag:e.tag,depth:e.depth};this.notify(t)}};export{AdwNavigationView,t as NOTIFY_VISIBLE_PAGE,r as POPPED,i as PUSHED,a as REPLACED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{NsOverlaySplitViewState as e,splitViewColumns as t}from"./split-view-state.js";import{AdwSplitViewBase as n}from"./split-view-base.js";import{GridLayout as r}from"@nativescript/core";var AdwOverlaySplitView=class extends n{_scrim=null;constructor(){super(`adw-overlay-split-view`,`overlay`,new e),this._applyLayout()}get pinSidebar(){return this._state.pinSidebar}set pinSidebar(e){this._state.setPinSidebar(!!e)}_applyLayout(){let e=t(this._state.sidebarPosition),n=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,r.setColumn(this._sidebar,e.sidebar),r.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`,r.setColumn(this._content,t?e.content:0),r.setColumnSpan(this._content,t?1:2)),this._applyPaneFocus();return}this._content&&(this._content.visibility=`visible`,r.setColumn(this._content,0),r.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(r.setColumn(this._scrim,0),r.setColumnSpan(this._scrim,2),this._scrim.visibility=this._state.shieldVisible?`visible`:`collapse`,this._scrim.opacity=+!!this._state.shieldVisible),this._sidebar&&(r.setColumn(this._sidebar,0),r.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=n?`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 r;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`,r.setColumn(this._content,0),r.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(r.setColumn(this._scrim,0),r.setColumnSpan(this._scrim,2)),this._sidebar&&(r.setColumn(this._sidebar,0),r.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{xmlBoolean as e}from"./xml-values.js";import{NsOverlaySplitViewState as t,splitViewColumns as n}from"./split-view-state.js";import{AdwSplitViewBase as r}from"./split-view-base.js";import{GridLayout as i}from"@nativescript/core";var AdwOverlaySplitView=class extends r{_scrim=null;constructor(){super(`adw-overlay-split-view`,`overlay`,new t),this._applyLayout()}get pinSidebar(){return this._state.pinSidebar}set pinSidebar(t){let n=e(t,this.pinSidebar);this._state.setPinSidebar(!!n)}_applyLayout(){let e=n(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,i.setColumn(this._sidebar,e.sidebar),i.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`,i.setColumn(this._content,t?e.content:0),i.setColumnSpan(this._content,t?1:2)),this._applyPaneFocus();return}this._content&&(this._content.visibility=`visible`,i.setColumn(this._content,0),i.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(i.setColumn(this._scrim,0),i.setColumnSpan(this._scrim,2),this._scrim.visibility=this._state.shieldVisible?`visible`:`collapse`,this._scrim.opacity=+!!this._state.shieldVisible),this._sidebar&&(i.setColumn(this._sidebar,0),i.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 i;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`,i.setColumn(this._content,0),i.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(i.setColumn(this._scrim,0),i.setColumnSpan(this._scrim,2)),this._sidebar&&(i.setColumn(this._sidebar,0),i.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{AdwImageButton as e}from"./adw-image-button.js";import{NS_PASSWORD_ENTRY_ROW_CLASS as t,applyPasswordEntryRowState as n}from"./entry-row-view.js";import{AdwEntryRow as r}from"./adw-entry-row.js";import{PasswordEntryRowState as i,PasswordEntryRowState as a}from"@gjsify/adwaita-core";import{dialogWarningSymbolic as o}from"@gjsify/adwaita-icons/status";const s=`notify::revealed`;var AdwPasswordEntryRow=class extends r{_password=new a(this._state);_peekButton;constructor(){super(),this._field.className=`adw-entry-field adw-password-field`;let t=new e;t.className=`${t.className} adw-password-peek`.trim(),t.addEventListener(`tap`,()=>this._password.togglePeek()),this.addSuffix(t),this._peekButton=t,this.setIndicatorIcon(o),this._renderPassword(this._password.state),this._password.subscribe(e=>{this._renderPassword(e);let t={eventName:s,object:this,revealed:e.revealed};this.notify(t)})}get revealed(){return this._password.revealed}set revealed(e){this._password.setRevealed(e)}get peeking(){return this._password.revealed}set peeking(e){this._password.setRevealed(e)}togglePeek(){return this._password.togglePeek()}get capsLockOn(){return this._password.capsLockOn}setCapsLockOn(e){this._password.setCapsLockOn(e)}get _baseClassName(){return t}_renderPassword(e){n({field:this._field,peekButton:this._peekButton},e)}};export{AdwPasswordEntryRow,s as NOTIFY_REVEALED,i as PasswordEntryRowState};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{AdwImageButton as t}from"./adw-image-button.js";import{NS_PASSWORD_ENTRY_ROW_CLASS as n,applyPasswordEntryRowState as r}from"./entry-row-view.js";import{AdwEntryRow as i}from"./adw-entry-row.js";import{PasswordEntryRowState as a,PasswordEntryRowState as o}from"@gjsify/adwaita-core";import{dialogWarningSymbolic as s}from"@gjsify/adwaita-icons/status";const c=`notify::revealed`;var AdwPasswordEntryRow=class extends i{_password=new o(this._state);_peekButton;constructor(){super(),this._field.className=`adw-entry-field adw-password-field`;let e=new t;e.className=`${e.className} adw-password-peek`.trim(),e.addEventListener(`tap`,()=>this._password.togglePeek()),this.addSuffix(e),this._peekButton=e,this.setIndicatorIcon(s),this._renderPassword(this._password.state),this._password.subscribe(e=>{this._renderPassword(e);let t={eventName:c,object:this,revealed:e.revealed};this.notify(t)})}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 n}_renderPassword(e){r({field:this._field,peekButton:this._peekButton},e)}};export{AdwPasswordEntryRow,c as NOTIFY_REVEALED,a as PasswordEntryRowState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwImageButton as e}from"./adw-image-button.js";import{searchNsPreferences as t}from"./preferences-search.js";import{GridLayout as n,ItemSpec as r,Label as i,StackLayout as a}from"@nativescript/core";import{windowCloseSymbolic as o}from"@gjsify/adwaita-icons/ui";const s=`closed`;var AdwPreferencesDialog=class extends n{_card;_headerBox;_titleLabel;_body;constructor(){super(),this.className=`adw-preferences-dialog`,this.visibility=`collapse`,this.addColumn(new r(1,`star`)),this.addRow(new r(1,`star`));let t=new n;t.className=`adw-preferences-dialog-card`,t.verticalAlignment=`middle`,t.horizontalAlignment=`center`,t.addColumn(new r(1,`star`)),t.addRow(new r(1,`auto`)),t.addRow(new r(1,`star`)),n.setColumn(t,0),n.setRow(t,0),this.addChild(t),this._card=t;let s=new n;s.className=`adw-preferences-dialog-header`,s.addColumn(new r(1,`star`)),s.addColumn(new r(1,`auto`)),s.addRow(new r(1,`auto`)),n.setRow(s,0),t.addChild(s),this._headerBox=s;let c=new i;c.className=`adw-preferences-dialog-title`,c.text=`Preferences`,n.setColumn(c,0),s.addChild(c),this._titleLabel=c;let l=new e;l.icon=o,l.className=`${l.className} adw-preferences-dialog-close`.trim(),l.addEventListener(`tap`,()=>this.close()),n.setColumn(l,1),s.addChild(l);let u=new a;u.orientation=`vertical`,u.className=`adw-preferences-dialog-body`,n.setRow(u,1),t.addChild(u),this._body=u}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??`Preferences`}add(e){this._body.addChild(e)}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,n){return t(this.searchPages,e,n)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:s,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(e){e?this.present():this.close()}get body(){return this._body}};export{AdwPreferencesDialog,s as CLOSED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{AdwImageButton as t}from"./adw-image-button.js";import{searchNsPreferences as n}from"./preferences-search.js";import{GridLayout as r,ItemSpec as i,Label as a,StackLayout as o}from"@nativescript/core";import{windowCloseSymbolic as s}from"@gjsify/adwaita-icons/ui";const c=`closed`;var AdwPreferencesDialog=class extends r{_card;_headerBox;_titleLabel;_body;constructor(){super(),this.className=`adw-preferences-dialog`,this.visibility=`collapse`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let e=new r;e.className=`adw-preferences-dialog-card`,e.verticalAlignment=`middle`,e.horizontalAlignment=`center`,e.addColumn(new i(1,`star`)),e.addRow(new i(1,`auto`)),e.addRow(new i(1,`star`)),r.setColumn(e,0),r.setRow(e,0),this.addChild(e),this._card=e;let n=new r;n.className=`adw-preferences-dialog-header`,n.addColumn(new i(1,`star`)),n.addColumn(new i(1,`auto`)),n.addRow(new i(1,`auto`)),r.setRow(n,0),e.addChild(n),this._headerBox=n;let c=new a;c.className=`adw-preferences-dialog-title`,c.text=`Preferences`,r.setColumn(c,0),n.addChild(c),this._titleLabel=c;let l=new t;l.icon=s,l.className=`${l.className} adw-preferences-dialog-close`.trim(),l.addEventListener(`tap`,()=>this.close()),r.setColumn(l,1),n.addChild(l);let u=new o;u.orientation=`vertical`,u.className=`adw-preferences-dialog-body`,r.setRow(u,1),e.addChild(u),this._body=u}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 n(this.searchPages,e,t)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:c,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,c as CLOSED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{PREFERENCES_GROUP_HEADER_CLASS as e,preferencesGroupVisuals as t}from"./preferences-group-state.js";import{GridLayout as n,ItemSpec as r,Label as i,StackLayout as a}from"@nativescript/core";var AdwPreferencesGroup=class extends a{_header;_titleLabel;_descriptionLabel;_suffixHost;_listbox;_title=``;_description=``;_headerSuffix=null;constructor(){super(),this.orientation=`vertical`,this.className=`adw-preferences-group`;let t=new n;t.className=e,t.addColumn(new r(1,`star`)),t.addColumn(new r(1,`auto`)),t.addRow(new r(1,`auto`));let o=new a;o.orientation=`vertical`,o.className=`adw-preferences-group-labels`,o.verticalAlignment=`middle`,n.setColumn(o,0),t.addChild(o);let s=new i;s.className=`adw-preferences-group-title`,s.textWrap=!0,o.addChild(s);let c=new i;c.className=`adw-preferences-group-description`,c.textWrap=!0,o.addChild(c);let l=new a;l.orientation=`horizontal`,l.className=`adw-preferences-group-suffix`,l.verticalAlignment=`middle`,n.setColumn(l,1),t.addChild(l);let u=new a;u.orientation=`vertical`,u.className=`boxed-list adw-preferences-group-listbox`,this.addChild(t),this.addChild(u),this._header=t,this._titleLabel=s,this._descriptionLabel=c,this._suffixHost=l,this._listbox=u,this._applyVisuals()}get title(){return this._title}set title(e){this._title=e??``,this._titleLabel.text=this._title,this._applyVisuals()}get description(){return this._description}set description(e){this._description=e??``,this._descriptionLabel.text=this._description,this._applyVisuals()}get headerSuffix(){return this._headerSuffix}set headerSuffix(e){e!==this._headerSuffix&&(this._headerSuffix&&this._suffixHost.removeChild(this._headerSuffix),this._headerSuffix=e,this._headerSuffix&&this._suffixHost.addChild(this._headerSuffix),this._applyVisuals())}addRow(e){this._listbox.addChild(e),this._refreshRowEdges(),this._applyVisuals()}removeRow(e){this._listbox.removeChild(e),this._refreshRowEdges(),this._applyVisuals()}searchRows(){let e=[],t=this._listbox.getChildrenCount();for(let n=0;n<t;n++)e.push(this._listbox.getChildAt(n));return e}_applyVisuals(){let e=t({title:this._title,description:this._description,hasHeaderSuffix:this._headerSuffix!==null,rowCount:this._listbox.getChildrenCount()});this._titleLabel.visibility=e.titleVisibility,this._descriptionLabel.visibility=e.descriptionVisibility,this._header.visibility=e.headerVisibility,this._header.className=e.headerClassName,this._listbox.visibility=e.listboxVisibility}_refreshRowEdges(){let e=this._listbox.getChildrenCount();for(let t=0;t<e;t++){let e=this._listbox.getChildAt(t);e&&this._setFlushTop(e,t===0)}}_setFlushTop(e,t){let n=(e.className??``).replace(/\s*\badw-row-flush-top\b/g,``);e.className=t?`${n} adw-row-flush-top`.trim():n.trim()}get listbox(){return this._listbox}};export{AdwPreferencesGroup};
1
+ import"../_virtual/_rolldown/runtime.js";import{resolveBuilderSlot as e}from"./builder-slots.js";import{PREFERENCES_GROUP_HEADER_CLASS as t,preferencesGroupVisuals as n}from"./preferences-group-state.js";import{GridLayout as r,ItemSpec as i,Label as a,StackLayout as o}from"@nativescript/core";const s=[`headerSuffix`];var AdwPreferencesGroup=class extends o{_header;_titleLabel;_descriptionLabel;_suffixHost;_listbox;_title=``;_description=``;_headerSuffix=null;constructor(){super(),this.orientation=`vertical`,this.className=`adw-preferences-group`;let e=new r;e.className=t,e.addColumn(new i(1,`star`)),e.addColumn(new i(1,`auto`)),e.addRow(new i(1,`auto`));let n=new o;n.orientation=`vertical`,n.className=`adw-preferences-group-labels`,n.verticalAlignment=`middle`,r.setColumn(n,0),e.addChild(n);let s=new a;s.className=`adw-preferences-group-title`,s.textWrap=!0,n.addChild(s);let c=new a;c.className=`adw-preferences-group-description`,c.textWrap=!0,n.addChild(c);let l=new o;l.orientation=`horizontal`,l.className=`adw-preferences-group-suffix`,l.verticalAlignment=`middle`,r.setColumn(l,1),e.addChild(l);let u=new o;u.orientation=`vertical`,u.className=`boxed-list adw-preferences-group-listbox`,this.addChild(e),this.addChild(u),this._header=e,this._titleLabel=s,this._descriptionLabel=c,this._suffixHost=l,this._listbox=u,this._applyVisuals()}get title(){return this._title}set title(e){this._title=e??``,this._titleLabel.text=this._title,this._applyVisuals()}get description(){return this._description}set description(e){this._description=e??``,this._descriptionLabel.text=this._description,this._applyVisuals()}get headerSuffix(){return this._headerSuffix}set headerSuffix(e){e!==this._headerSuffix&&(this._headerSuffix&&this._suffixHost.removeChild(this._headerSuffix),this._headerSuffix=e,this._headerSuffix&&this._suffixHost.addChild(this._headerSuffix),this._applyVisuals())}_addChildFromBuilder(t,n){if(e(t,s,`row`)===`headerSuffix`){this.headerSuffix=n;return}this.addRow(n)}addRow(e){this._listbox.addChild(e),this._refreshRowEdges(),this._applyVisuals()}removeRow(e){this._listbox.removeChild(e),this._refreshRowEdges(),this._applyVisuals()}searchRows(){let e=[],t=this._listbox.getChildrenCount();for(let n=0;n<t;n++)e.push(this._listbox.getChildAt(n));return e}_applyVisuals(){let e=n({title:this._title,description:this._description,hasHeaderSuffix:this._headerSuffix!==null,rowCount:this._listbox.getChildrenCount()});this._titleLabel.visibility=e.titleVisibility,this._descriptionLabel.visibility=e.descriptionVisibility,this._header.visibility=e.headerVisibility,this._header.className=e.headerClassName,this._listbox.visibility=e.listboxVisibility}_refreshRowEdges(){let e=this._listbox.getChildrenCount();for(let t=0;t<e;t++){let e=this._listbox.getChildAt(t);e&&this._setFlushTop(e,t===0)}}_setFlushTop(e,t){let n=(e.className??``).replace(/\s*\badw-row-flush-top\b/g,``);e.className=t?`${n} adw-row-flush-top`.trim():n.trim()}get listbox(){return this._listbox}};export{AdwPreferencesGroup};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{ScrollView as e,StackLayout as t}from"@nativescript/core";var AdwPreferencesPage=class extends e{_content;_title=``;_name=``;_iconName=``;_useUnderline=!1;constructor(){super(),this.orientation=`vertical`,this.className=`adw-preferences-page`;let e=new t;e.orientation=`vertical`,e.className=`adw-preferences-page-content`,this.content=e,this._content=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(e){this._useUnderline=e===!0}addGroup(e){this._content.addChild(e)}removeGroup(e){this._content.removeChild(e)}searchGroups(){let e=[],t=this._content.getChildrenCount();for(let n=0;n<t;n++){let t=this._content.getChildAt(n);typeof t.searchRows==`function`&&e.push(t)}return e}get groups(){return this._content}};export{AdwPreferencesPage};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{ScrollView as t,StackLayout as n}from"@nativescript/core";var AdwPreferencesPage=class extends t{_content;_title=``;_name=``;_iconName=``;_useUnderline=!1;constructor(){super(),this.orientation=`vertical`,this.className=`adw-preferences-page`;let e=new n;e.orientation=`vertical`,e.className=`adw-preferences-page-content`,this.content=e,this._content=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)}addGroup(e){this._content.addChild(e)}removeGroup(e){this._content.removeChild(e)}_addChildFromBuilder(e,t){this.addGroup(t)}searchGroups(){let e=[],t=this._content.getChildrenCount();for(let n=0;n<t;n++){let t=this._content.getChildAt(n);typeof t.searchRows==`function`&&e.push(t)}return e}get groups(){return this._content}};export{AdwPreferencesPage};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{attachRowPressFeedback as e}from"./row-press.js";import{SidebarState as t,sidebarRowClassName as n,sidebarSectionsFromLabels as r}from"./sidebar-model.js";import{GridLayout as i,ItemSpec as a,Label as o,ScrollView as s,StackLayout as c}from"@nativescript/core";const l=`notify::selected`,u=`activated`;var AdwSidebar=class extends s{_list;_state=new t;_rows=[];constructor(){super(),this.orientation=`vertical`,this.className=`adw-sidebar`;let e=new c;e.orientation=`vertical`,e.className=`adw-sidebar-list`,this.content=e,this._list=e,this._state.subscribe(e=>{this._applySelection();let t={eventName:l,object:this,selected:e.selected,title:e.item?.title??``,previous:e.previous,interactive:e.interactive};this.notify(t)})}setItems(e){this.setSections(r(Array.isArray(e)?e:[]))}setSections(e){this._state.setSections(e),this._rebuild()}_rebuild(){for(let e of this._rows)this._list.removeChild(e.view);this._rows.length=0;for(let t of this._state.visibleItems){let n=new i;n.className=`adw-sidebar-row`,n.addColumn(new a(1,`star`)),n.addRow(new a(1,`auto`));let r=new o;r.className=`adw-sidebar-row-title`,r.text=t.item.title,r.textWrap=!0,i.setColumn(r,0),n.addChild(r),t.item.visible===!1&&(n.visibility=`collapse`),t.item.enabled===!1&&(n.opacity=.5),n.addEventListener(`tap`,()=>this._activate(t.index)),e(n),this._list.addChild(n),this._rows.push({view:n,index:t.index})}this._applySelection()}_activate(e){if(!this._state.activate(e).activated)return;let t={eventName:u,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 r of this._rows)r.view.className=n(r.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){this._state.setSelected(e)}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{u as ACTIVATED,AdwSidebar,l as NOTIFY_SELECTED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{attachRowPressFeedback as t}from"./row-press.js";import{SidebarState as n,sidebarRowClassName as r,sidebarSectionsFromLabels as i}from"./sidebar-model.js";import{GridLayout as a,ItemSpec as o,Label as s,ScrollView as c,StackLayout as l}from"@nativescript/core";const u=`notify::selected`,d=`activated`;var AdwSidebar=class extends c{_list;_state=new n;_rows=[];constructor(){super(),this.orientation=`vertical`,this.className=`adw-sidebar`;let e=new l;e.orientation=`vertical`,e.className=`adw-sidebar-list`,this.content=e,this._list=e,this._state.subscribe(e=>{this._applySelection();let t={eventName:u,object:this,selected:e.selected,title:e.item?.title??``,previous:e.previous,interactive:e.interactive};this.notify(t)})}setItems(e){this.setSections(i(Array.isArray(e)?e:[]))}setSections(e){this._state.setSections(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 n=new a;n.className=`adw-sidebar-row`,n.addColumn(new o(1,`star`)),n.addRow(new o(1,`auto`));let r=new s;r.className=`adw-sidebar-row-title`,r.text=e.item.title,r.textWrap=!0,a.setColumn(r,0),n.addChild(r),e.item.visible===!1&&(n.visibility=`collapse`),e.item.enabled===!1&&(n.opacity=.5),n.addEventListener(`tap`,()=>this._activate(e.index)),t(n),this._list.addChild(n),this._rows.push({view:n,index:e.index})}this._applySelection()}_activate(e){if(!this._state.activate(e).activated)return;let t={eventName:d,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=r(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);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{d as ACTIVATED,AdwSidebar,u as NOTIFY_SELECTED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t,Label as n,Slider as r,StackLayout as i}from"@nativescript/core";const a=`notify::value`;var AdwSliderRow=class extends i{_titleLabel;_valueLabel;_slider;_value=0;_min=0;_max=100;_step=1;_suppress=!1;constructor(){super(),this.orientation=`vertical`,this.className=`adw-slider-row`;let i=new e;i.className=`adw-slider-header`,i.addRow(new t(1,`auto`)),i.addColumn(new t(1,`star`)),i.addColumn(new t(1,`auto`));let o=new n;o.className=`adw-slider-title`,o.textWrap=!1,e.setColumn(o,0),i.addChild(o);let s=new n;s.className=`adw-slider-value`,s.text=String(this._value),e.setColumn(s,1),i.addChild(s);let c=new r;c.className=`adw-slider`,c.minValue=this._min,c.maxValue=this._max,c.value=this._value,this.addChild(i),this.addChild(c),this._titleLabel=o,this._valueLabel=s,this._slider=c,c.addEventListener(`valueChange`,()=>{if(this._suppress)return;let e=this._snap(this._slider.value);if(e!==this._slider.value&&(this._suppress=!0,this._slider.value=e,this._suppress=!1),e!==this._value){this._value=e,this._valueLabel.text=String(e);let t={eventName:a,object:this,value:e};this.notify(t)}})}_snap(e){let t=Math.min(this._max,Math.max(this._min,e)),n=Math.round((t-this._min)/this._step);return Math.min(this._max,this._min+n*this._step)}_sync(){this._suppress=!0,this._slider.value=this._value,this._suppress=!1,this._valueLabel.text=String(this._value)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get value(){return this._value}set value(e){let t=this._snap(Number.isFinite(e)?e:0);t!==this._value&&(this._value=t,this._sync())}get min(){return this._min}set min(e){this._min=Number.isFinite(e)?e:0,this._slider.minValue=this._min,this.value=this._value}get max(){return this._max}set max(e){this._max=Number.isFinite(e)?e:100,this._slider.maxValue=this._max,this.value=this._value}get step(){return this._step}set step(e){this._step=Number.isFinite(e)&&e>0?e:1}get slider(){return this._slider}};export{AdwSliderRow,a as NOTIFY_SLIDER_VALUE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{GridLayout as t,ItemSpec as n,Label as r,Slider as i,StackLayout as a}from"@nativescript/core";const o=`notify::value`;var AdwSliderRow=class extends a{_titleLabel;_valueLabel;_slider;_value=0;_min=0;_max=100;_step=1;_suppress=!1;constructor(){super(),this.orientation=`vertical`,this.className=`adw-slider-row`;let e=new t;e.className=`adw-slider-header`,e.addRow(new n(1,`auto`)),e.addColumn(new n(1,`star`)),e.addColumn(new n(1,`auto`));let a=new r;a.className=`adw-slider-title`,a.textWrap=!1,t.setColumn(a,0),e.addChild(a);let s=new r;s.className=`adw-slider-value`,s.text=String(this._value),t.setColumn(s,1),e.addChild(s);let c=new i;c.className=`adw-slider`,c.minValue=this._min,c.maxValue=this._max,c.value=this._value,this.addChild(e),this.addChild(c),this._titleLabel=a,this._valueLabel=s,this._slider=c,c.addEventListener(`valueChange`,()=>{if(this._suppress)return;let e=this._snap(this._slider.value);if(e!==this._slider.value&&(this._suppress=!0,this._slider.value=e,this._suppress=!1),e!==this._value){this._value=e,this._valueLabel.text=String(e);let t={eventName:o,object:this,value:e};this.notify(t)}})}_snap(e){let t=Math.min(this._max,Math.max(this._min,e)),n=Math.round((t-this._min)/this._step);return Math.min(this._max,this._min+n*this._step)}_sync(){this._suppress=!0,this._slider.value=this._value,this._suppress=!1,this._valueLabel.text=String(this._value)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get value(){return this._value}set value(t){let n=e(t,this.value),r=this._snap(Number.isFinite(n)?n:0);r!==this._value&&(this._value=r,this._sync())}get min(){return this._min}set min(t){let n=e(t,this.min);this._min=Number.isFinite(n)?n:0,this._slider.minValue=this._min,this.value=this._value}get max(){return this._max}set max(t){let n=e(t,this.max);this._max=Number.isFinite(n)?n:100,this._slider.maxValue=this._max,this.value=this._value}get step(){return this._step}set step(t){let n=e(t,this.step);this._step=Number.isFinite(n)&&n>0?n:1}get slider(){return this._slider}};export{AdwSliderRow,o as NOTIFY_SLIDER_VALUE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{AdwImageButton as t}from"./adw-image-button.js";import{Label as n,StackLayout as r}from"@nativescript/core";import{SpinState as i,SpinState as a}from"@gjsify/adwaita-core";import{valueDecreaseSymbolic as o,valueIncreaseSymbolic as s}from"@gjsify/adwaita-icons/actions";const c=`notify::value`;var AdwSpinRow=class extends e{_minusButton;_plusButton;_valueLabel;_state=new a;constructor(){super(),this.className=`adw-row adw-action-row adw-spin-row`;let e=new r;e.orientation=`horizontal`,e.className=`adw-spin-control`;let i=new n;i.className=`adw-spin-value`,i.text=String(this._state.value);let a=new t;a.icon=o,a.className=`${a.className} adw-spin-button adw-spin-minus`.trim();let l=new t;l.icon=s,l.className=`${l.className} adw-spin-button adw-spin-plus`.trim(),e.addChild(i),e.addChild(a),e.addChild(l),this.setSuffix(e),this._minusButton=a,this._plusButton=l,this._valueLabel=i,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:c,object:this,value:e.value};this.notify(t)}}),a.addEventListener(`tap`,()=>this._state.decrement()),l.addEventListener(`tap`,()=>this._state.increment())}get value(){return this._state.value}set value(e){this._state.setValue(e)}get min(){return this._state.min}set min(e){this._state.setMin(e)}get max(){return this._state.max}set max(e){this._state.setMax(e)}get step(){return this._state.step}set step(e){this._state.setStep(e)}};export{AdwSpinRow,c as NOTIFY_VALUE,i as SpinState};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwActionRow as t}from"./adw-action-row.js";import{AdwImageButton as n}from"./adw-image-button.js";import{Label as r,StackLayout as i}from"@nativescript/core";import{SpinState as a,SpinState as o}from"@gjsify/adwaita-core";import{valueDecreaseSymbolic as s,valueIncreaseSymbolic as c}from"@gjsify/adwaita-icons/actions";const l=`notify::value`;var AdwSpinRow=class extends t{_minusButton;_plusButton;_valueLabel;_state=new o;constructor(){super(),this.className=`adw-row adw-action-row adw-spin-row`;let e=new i;e.orientation=`horizontal`,e.className=`adw-spin-control`;let t=new r;t.className=`adw-spin-value`,t.text=String(this._state.value);let a=new n;a.icon=s,a.className=`${a.className} adw-spin-button adw-spin-minus`.trim();let o=new n;o.icon=c,o.className=`${o.className} adw-spin-button adw-spin-plus`.trim(),e.addChild(t),e.addChild(a),e.addChild(o),this.setSuffix(e),this._minusButton=a,this._plusButton=o,this._valueLabel=t,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:l,object:this,value:e.value};this.notify(t)}}),a.addEventListener(`tap`,()=>this._state.decrement()),o.addEventListener(`tap`,()=>this._state.increment())}get value(){return this._state.value}set value(t){this._state.setValue(e(t,this._state.value))}get min(){return this._state.min}set min(t){this._state.setMin(e(t,this._state.min))}get max(){return this._state.max}set max(t){this._state.setMax(e(t,this._state.max))}get step(){return this._state.step}set step(t){this._state.setStep(e(t,this._state.step))}};export{AdwSpinRow,l as NOTIFY_VALUE,a as SpinState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{DEFAULT_SPINNER_SIZE as e}from"./chrome.js";import{ActivityIndicator as t,GridLayout as n,ItemSpec as r}from"@nativescript/core";import{resolveSpinnerSize as i,spinnerGeometry as a}from"@gjsify/adwaita-core";var AdwSpinner=class extends n{_indicator;_size=e;_spinning=!0;constructor(){super(),this.className=`adw-spinner`,this.addRow(new r(1,`star`)),this.addColumn(new r(1,`star`));let e=new t;e.className=`adw-spinner-ring`,e.horizontalAlignment=`center`,e.verticalAlignment=`center`,this._indicator=e,this.addChild(e),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning()}_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=!!e,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,e as DEFAULT_SPINNER_SIZE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{DEFAULT_SPINNER_SIZE as t}from"./chrome.js";import{ActivityIndicator as n,GridLayout as r,ItemSpec as i}from"@nativescript/core";import{resolveSpinnerSize as a,spinnerGeometry as o}from"@gjsify/adwaita-core";var AdwSpinner=class extends r{_indicator;_size=t;_spinning=!0;constructor(){super(),this.className=`adw-spinner`,this.addRow(new i(1,`star`)),this.addColumn(new i(1,`star`));let e=new n;e.className=`adw-spinner-ring`,e.horizontalAlignment=`center`,e.verticalAlignment=`center`,this._indicator=e,this.addChild(e),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning()}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=o(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=a(e),this._applySize()}get ringDiameter(){return o(this._size,this._size).diameter}};export{AdwSpinner,t as DEFAULT_SPINNER_SIZE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{attachRowPressFeedback as t}from"./row-press.js";import{MENU_CANCEL_LABEL as n,menuSheetActions as r,resolveMenuChoice as i,setActionIcon as a,splitButtonArrowSvg as o,toMenuEntries as s}from"./split-button.js";import{GridLayout as c,ItemSpec as l,Label as u,StackLayout as d,action as f}from"@nativescript/core";import{SPLIT_BUTTON_DISABLED_OPACITY as p,SplitButtonState as m}from"@gjsify/adwaita-core";const h=`clicked`,g=`menuTapped`;var AdwSplitButton=class extends c{_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new m;_showingIcon=!1;_disabled=!1;constructor(){super(),this.className=`adw-split-button`,this.addColumn(new l(1,`auto`)),this.addColumn(new l(1,`auto`)),this.addRow(new l(1,`auto`));let n=new d;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,c.setColumn(n,0);let r=new u;r.className=`adw-split-button-label`,r.verticalAlignment=`middle`,n.addChild(r);let i=new e;i.className=`${i.className} adw-split-button-action-icon`.trim(),i.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=r,this._actionIcon=i;let a=new c;a.className=`adw-split-button-dropdown`,a.addColumn(new l(1,`star`)),a.addRow(new l(1,`star`)),c.setColumn(a,1);let s=new e;s.className=`${s.className} adw-split-button-chevron`.trim(),s.icon=o(this._state.direction),s.horizontalAlignment=`center`,s.verticalAlignment=`middle`,a.addChild(s),this.addChild(a),this._dropdownPart=a,this._chevron=s,n.addEventListener(`tap`,()=>{if(this._disabled)return;let e={eventName:h,object:this};this.notify(e)}),a.addEventListener(`tap`,()=>{this._openMenu()}),t(n),t(a),this._state.subscribe(()=>this._render()),this._render()}async _openMenu(){if(this._disabled||this._state.open||!this._state.dropdownEnabled)return;let e=r(this._state.menuModel??[],n);this._state.toggleMenu();let t=i(e,await f({title:this._state.label||void 0,cancelButtonText:n,actions:e})),a=this._state.activateMenuEntry(t);if(a===null){this._state.closeMenu();return}let o={eventName:g,object:this,item:a.label,index:t,action:a.action};this.notify(o)}_render(){let{mode:e,label:t,iconName:n,direction:r,dropdownEnabled:i}=this._state,a=e===`icon`;a?this._actionIcon.icon=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.icon=o(r),this._dropdownPart.opacity=i?1:p,this.opacity=this._disabled?p:1}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get actionIcon(){return this._state.iconName??``}set actionIcon(e){a(this._state,e)}get menu(){return this._state.menuModel??[]}set menu(e){this._state.setMenuModel(s(e))}get direction(){return this._state.direction}set direction(e){this._state.setDirection(e)}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(e){this._state.setUseUnderline(!!e)}get disabled(){return this._disabled}set disabled(e){let t=!!e;t!==this._disabled&&(this._disabled=t,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,h as CLICKED,g as MENU_TAPPED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{MENU_CANCEL_LABEL as r,menuSheetActions as i,resolveMenuChoice as a,setActionIcon as o,splitButtonArrowSvg as s,toMenuEntries as c}from"./split-button.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f,action as p}from"@nativescript/core";import{SPLIT_BUTTON_DISABLED_OPACITY as m,SplitButtonState as h}from"@gjsify/adwaita-core";const g=`clicked`,_=`menuTapped`;var AdwSplitButton=class extends l{_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new h;_showingIcon=!1;_disabled=!1;constructor(){super(),this.className=`adw-split-button`,this.addColumn(new u(1,`auto`)),this.addColumn(new u(1,`auto`)),this.addRow(new u(1,`auto`));let e=new f;e.orientation=`horizontal`,e.className=`adw-split-button-action`,e.horizontalAlignment=`center`,l.setColumn(e,0);let r=new d;r.className=`adw-split-button-label`,r.verticalAlignment=`middle`,e.addChild(r);let i=new t;i.className=`${i.className} adw-split-button-action-icon`.trim(),i.verticalAlignment=`middle`,this.addChild(e),this._actionPart=e,this._actionLabel=r,this._actionIcon=i;let a=new l;a.className=`adw-split-button-dropdown`,a.addColumn(new u(1,`star`)),a.addRow(new u(1,`star`)),l.setColumn(a,1);let o=new t;o.className=`${o.className} adw-split-button-chevron`.trim(),o.icon=s(this._state.direction),o.horizontalAlignment=`center`,o.verticalAlignment=`middle`,a.addChild(o),this.addChild(a),this._dropdownPart=a,this._chevron=o,e.addEventListener(`tap`,()=>{if(this._disabled)return;let e={eventName:g,object:this};this.notify(e)}),a.addEventListener(`tap`,()=>{this._openMenu()}),n(e),n(a),this._state.subscribe(()=>this._render()),this._render()}async _openMenu(){if(this._disabled||this._state.open||!this._state.dropdownEnabled)return;let e=i(this._state.menuModel??[],r);this._state.toggleMenu();let t=a(e,await p({title:this._state.label||void 0,cancelButtonText:r,actions:e})),n=this._state.activateMenuEntry(t);if(n===null){this._state.closeMenu();return}let o={eventName:_,object:this,item:n.label,index:t,action:n.action};this.notify(o)}_render(){let{mode:e,label:t,iconName:n,direction:r,dropdownEnabled:i}=this._state,a=e===`icon`;a?this._actionIcon.icon=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.icon=s(r),this._dropdownPart.opacity=i?1:m,this.opacity=this._disabled?m:1}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get actionIcon(){return this._state.iconName??``}set actionIcon(e){o(this._state,e)}get menu(){return this._state.menuModel??[]}set menu(e){this._state.setMenuModel(c(e))}get direction(){return this._state.direction}set direction(e){this._state.setDirection(e)}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 disabled(){return this._disabled}set disabled(t){let n=!!e(t,this.disabled);n!==this._disabled&&(this._disabled=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,g as CLICKED,_ as MENU_TAPPED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{statusPageIconVisibility as t,statusPageLabelVisibility as n}from"./status-page-content.js";import{GridLayout as r,ItemSpec as i,Label as a,StackLayout as o}from"@nativescript/core";var AdwStatusPage=class extends r{_stack;_icon;_iconSvg=``;_iconLabel;_iconGlyph=``;_titleLabel;_descriptionLabel;_child=null;constructor(){super(),this.className=`adw-status-page`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let s=new o;s.orientation=`vertical`,s.className=`adw-status-page-content`,s.horizontalAlignment=`center`,s.verticalAlignment=`middle`,r.setColumn(s,0),r.setRow(s,0),this.addChild(s),this._stack=s;let c=new e;c.className=`${c.className} adw-status-page-icon`.trim(),c.horizontalAlignment=`center`,c.iconColor=`#9b9b9b`,c.iconSize=96,c.visibility=t(this._iconSvg),this._icon=c;let l=new a;l.className=`adw-status-page-icon-glyph`,l.horizontalAlignment=`center`,l.visibility=t(this._iconGlyph),this._iconLabel=l;let u=new a;u.className=`adw-status-page-title`,u.horizontalAlignment=`center`,u.textWrap=!0,u.visibility=n(u.text),this._titleLabel=u;let d=new a;d.className=`adw-status-page-description`,d.horizontalAlignment=`center`,d.textWrap=!0,d.visibility=n(d.text),this._descriptionLabel=d;for(let e of[c,l,u,d])s.addChild(e)}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._icon.icon=this._iconSvg,this._icon.visibility=t(this._iconSvg),this._iconLabel.visibility=`collapse`}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._iconLabel.visibility=t(this._iconGlyph),this._icon.visibility=`collapse`}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){let t=e??``;this._titleLabel.text=t,this._titleLabel.visibility=n(t)}get description(){return this._descriptionLabel.text??``}set description(e){let t=e??``;this._descriptionLabel.text=t,this._descriptionLabel.visibility=n(t)}setChild(e){this._child&&=(this._stack.removeChild(this._child),null),e&&(e.className=`${e.className??``} adw-status-page-child`.trim(),e.horizontalAlignment=`center`,this._stack.addChild(e),this._child=e)}get child(){return this._child}};export{AdwStatusPage};
1
+ import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{statusPageIconVisibility as t,statusPageLabelVisibility as n}from"./status-page-content.js";import{GridLayout as r,ItemSpec as i,Label as a,StackLayout as o}from"@nativescript/core";var AdwStatusPage=class extends r{_stack;_icon;_iconSvg=``;_iconLabel;_iconGlyph=``;_titleLabel;_descriptionLabel;_child=null;constructor(){super(),this.className=`adw-status-page`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let s=new o;s.orientation=`vertical`,s.className=`adw-status-page-content`,s.horizontalAlignment=`center`,s.verticalAlignment=`middle`,r.setColumn(s,0),r.setRow(s,0),this.addChild(s),this._stack=s;let c=new e;c.className=`${c.className} adw-status-page-icon`.trim(),c.horizontalAlignment=`center`,c.iconColor=`#9b9b9b`,c.iconSize=96,c.visibility=t(this._iconSvg),this._icon=c;let l=new a;l.className=`adw-status-page-icon-glyph`,l.horizontalAlignment=`center`,l.visibility=t(this._iconGlyph),this._iconLabel=l;let u=new a;u.className=`adw-status-page-title`,u.horizontalAlignment=`center`,u.textWrap=!0,u.visibility=n(u.text),this._titleLabel=u;let d=new a;d.className=`adw-status-page-description`,d.horizontalAlignment=`center`,d.textWrap=!0,d.visibility=n(d.text),this._descriptionLabel=d;for(let e of[c,l,u,d])s.addChild(e)}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._icon.icon=this._iconSvg,this._icon.visibility=t(this._iconSvg),this._iconLabel.visibility=`collapse`}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._iconLabel.visibility=t(this._iconGlyph),this._icon.visibility=`collapse`}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){let t=e??``;this._titleLabel.text=t,this._titleLabel.visibility=n(t)}get description(){return this._descriptionLabel.text??``}set description(e){let t=e??``;this._descriptionLabel.text=t,this._descriptionLabel.visibility=n(t)}setChild(e){this._child&&=(this._stack.removeChild(this._child),null),e&&(e.className=`${e.className??``} adw-status-page-child`.trim(),e.horizontalAlignment=`center`,this._stack.addChild(e),this._child=e)}get child(){return this._child}_addChildFromBuilder(e,t){this.setChild(t)}};export{AdwStatusPage};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{SwitchRowState as e}from"./row-state.js";import{AdwActionRow as t}from"./adw-action-row.js";import{Switch as n}from"@nativescript/core";const r=`notify::active`;var AdwSwitchRow=class extends t{_switch;_switchState=new e;constructor(){super(),this.className=`adw-row adw-action-row adw-switch-row`;let e=new n;e.className=`adw-switch`,this.setSuffix(e),this._switch=e,this.activatableWidget=e,this.activatable=!0,e.addEventListener(`checkedChange`,()=>this._apply(this._switchState.setActive(e.checked)))}get active(){return this._switchState.active}set active(e){this._apply(this._switchState.setActive(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:r,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,r as NOTIFY_ACTIVE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{SwitchRowState as t}from"./row-state.js";import{AdwActionRow as n}from"./adw-action-row.js";import{Switch as r}from"@nativescript/core";const i=`notify::active`;var AdwSwitchRow=class extends n{_switch;_switchState=new t;constructor(){super(),this.className=`adw-row adw-action-row adw-switch-row`;let e=new r;e.className=`adw-switch`,this.setSuffix(e),this._switch=e,this.activatableWidget=e,this.activatable=!0,e.addEventListener(`checkedChange`,()=>this._apply(this._switchState.setActive(e.checked)))}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:i,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,i as NOTIFY_ACTIVE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{attachRowPressFeedback as t}from"./row-press.js";import{AdwImageButton as n}from"./adw-image-button.js";import{applyTabViewVisibility as r,createTabViewState as i,tabBarVisibility as a,tabCloseVisibilities as o,tabLabelText as s,tabViewNotifyPayload as c}from"./tab-view-state.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";import{tabIconState as p}from"@gjsify/adwaita-core";import{windowCloseSymbolic as m}from"@gjsify/adwaita-icons/ui";const h=`notify::selected-page`,g=`pages-changed`,_=`close-page`;var AdwTabView=class extends l{_state=i({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(){super(),this.className=`adw-tab-view`,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addRow(new u(1,`star`));let e=new f;e.orientation=`horizontal`,e.horizontalAlignment=`stretch`,e.className=`adw-tab-view-bar`,l.setRow(e,0),this.addChild(e),this._bar=e;let t=new l;t.addColumn(new u(1,`star`)),t.addRow(new u(1,`star`)),l.setRow(t,1),this.addChild(t),this._contentArea=t,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:h,object:this,...c(e)};this.notify(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 selected(){return this._state.selectedIndex}set selected(e){this._state.selectNthPage(e)}isClosing(e){return this._state.isClosing(e)}setSelectedPage(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}selectPreviousPage(){return this._state.selectPreviousPage()}selectNextPage(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}addPage(e,t=null){return this._state.addPage(e,t)}insertPage(e,t){return this._state.insertPage(e,t)}prependPage(e){return this._state.prependPage(e)}appendPage(e){return this._state.appendPage(e)}insertPinnedPage(e,t){return this._state.insertPinnedPage(e,t)}prependPinnedPage(e){return this._state.prependPinnedPage(e)}appendPinnedPage(e){return this._state.appendPinnedPage(e)}setPagePinned(e,t){return this._state.setPagePinned(e,t)}closePage(e){return this._state.closePage(e)}closePageFinish(e,t){return this._state.closePageFinish(e,t)}closeOtherPages(e){this._state.closeOtherPages(e)}closePagesBefore(e){this._state.closePagesBefore(e)}closePagesAfter(e){this._state.closePagesAfter(e)}detachPage(e){return this._state.detachPage(e)}reorderPage(e,t){return this._state.reorderPage(e,t)}reorderBackward(e){return this._state.reorderBackward(e)}reorderForward(e){return this._state.reorderForward(e)}reorderFirst(e){return this._state.reorderFirst(e)}reorderLast(e){return this._state.reorderLast(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){this._autohide=!!e,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}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:g,object:this,...e};this.notify(t)}_insertChip(r,i){let a=new f;a.orientation=`horizontal`,a.className=`adw-tab-view-tab`,a.verticalAlignment=`middle`;let o=new e;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,a.addChild(o);let s=new e;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,a.addChild(s);let c=new d;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,a.addChild(c);let u=new n;u.className=`${u.className} adw-tab-close`.trim(),u.icon=m,u.iconSize=12,u.verticalAlignment=`middle`,u.addEventListener(`tap`,()=>this._state.closePage(r.id)),a.addChild(u),t(a),a.addEventListener(`tap`,()=>this._state.setSelectedPage(r.id)),this._bar.insertChild(a,i),this._chips.set(r.id,{button:a,icon:o,indicator:s,label:c,close:u});let p=r.content;p&&(l.setColumn(p,0),l.setRow(p,0),this._contentArea.addChild(p)),this._refreshChip(r.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=s(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=p(t,this._defaultIcon);n.icon.icon=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.icon=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){r(this._state);let e=o(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=a(this._state,this._autohide)}_requestClose(e){let t={eventName:_,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,_ as CLOSE_PAGE,h as NOTIFY_SELECTED_PAGE,g as PAGES_CHANGED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{AdwIcon as n}from"./adw-icon.js";import{attachRowPressFeedback as r}from"./row-press.js";import{AdwImageButton as i}from"./adw-image-button.js";import{applyTabViewVisibility as a,createTabViewState as o,tabBarVisibility as s,tabCloseVisibilities as c,tabLabelText as l,tabViewNotifyPayload as u}from"./tab-view-state.js";import{GridLayout as d,ItemSpec as f,Label as p,StackLayout as m}from"@nativescript/core";import{tabIconState as h}from"@gjsify/adwaita-core";import{windowCloseSymbolic as g}from"@gjsify/adwaita-icons/ui";const _=`notify::selected-page`,v=`pages-changed`,y=`close-page`;var AdwTabView=class extends d{_state=o({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(){super(),this.className=`adw-tab-view`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`auto`)),this.addRow(new f(1,`star`));let e=new m;e.orientation=`horizontal`,e.horizontalAlignment=`stretch`,e.className=`adw-tab-view-bar`,d.setRow(e,0),this.addChild(e),this._bar=e;let t=new d;t.addColumn(new f(1,`star`)),t.addRow(new f(1,`star`)),d.setRow(t,1),this.addChild(t),this._contentArea=t,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:_,object:this,...u(e)};this.notify(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 selected(){return this._state.selectedIndex}set selected(e){let n=t(e,this.selected);this._state.selectNthPage(n)}isClosing(e){return this._state.isClosing(e)}setSelectedPage(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}selectPreviousPage(){return this._state.selectPreviousPage()}selectNextPage(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}addPage(e,t=null){return this._state.addPage(e,t)}insertPage(e,t){return this._state.insertPage(e,t)}prependPage(e){return this._state.prependPage(e)}appendPage(e){return this._state.appendPage(e)}insertPinnedPage(e,t){return this._state.insertPinnedPage(e,t)}prependPinnedPage(e){return this._state.prependPinnedPage(e)}appendPinnedPage(e){return this._state.appendPinnedPage(e)}setPagePinned(e,t){return this._state.setPagePinned(e,t)}closePage(e){return this._state.closePage(e)}closePageFinish(e,t){return this._state.closePageFinish(e,t)}closeOtherPages(e){this._state.closeOtherPages(e)}closePagesBefore(e){this._state.closePagesBefore(e)}closePagesAfter(e){this._state.closePagesAfter(e)}detachPage(e){return this._state.detachPage(e)}reorderPage(e,t){return this._state.reorderPage(e,t)}reorderBackward(e){return this._state.reorderBackward(e)}reorderForward(e){return this._state.reorderForward(e)}reorderFirst(e){return this._state.reorderFirst(e)}reorderLast(e){return this._state.reorderLast(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)}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:v,object:this,...e};this.notify(t)}_insertChip(e,t){let a=new m;a.orientation=`horizontal`,a.className=`adw-tab-view-tab`,a.verticalAlignment=`middle`;let o=new n;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,a.addChild(o);let s=new n;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,a.addChild(s);let c=new p;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,a.addChild(c);let l=new i;l.className=`${l.className} adw-tab-close`.trim(),l.icon=g,l.iconSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),a.addChild(l),r(a),a.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(a,t),this._chips.set(e.id,{button:a,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(d.setColumn(u,0),d.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=l(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=h(t,this._defaultIcon);n.icon.icon=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.icon=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){a(this._state);let e=c(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=s(this._state,this._autohide)}_requestClose(e){let t={eventName:y,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,y as CLOSE_PAGE,_ as NOTIFY_SELECTED_PAGE,v as PAGES_CHANGED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{Label as t,StackLayout as n}from"@nativescript/core";import{ToggleGroupState as r,ToggleGroupState as i}from"@gjsify/adwaita-core";const a=`notify::selected`;var AdwToggleGroup=class extends n{_toggles=[];_segments=[];_state=new i;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:a,object:this,selected:e.selected,value:e.value};this.notify(t)})}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(r){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=Array.isArray(r)?r:[],this._toggles.forEach((r,i)=>{let a=new n;if(a.orientation=`horizontal`,a.className=`adw-toggle-button`,a.horizontalAlignment=`center`,r.icon){let t=new e;t.className=`${t.className} adw-toggle-icon`.trim(),t.verticalAlignment=`middle`,t.icon=r.icon,a.addChild(t)}let o=new t;o.text=r.label,o.className=`adw-toggle-label`,o.verticalAlignment=`middle`,a.addChild(o),a.addEventListener(`tap`,()=>{this._state.setSelected(i)}),this.addChild(a),this._segments.push(a)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get selected(){return this._state.selected}set selected(e){this._state.setSelected(e)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,a as NOTIFY_SELECTED,r as ToggleGroupState};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{Label as n,StackLayout as r}from"@nativescript/core";import{ToggleGroupState as i,ToggleGroupState as a}from"@gjsify/adwaita-core";const o=`notify::selected`;var AdwToggleGroup=class extends r{_toggles=[];_segments=[];_state=new a;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:o,object:this,selected:e.selected,value:e.value};this.notify(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){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=Array.isArray(e)?e:[],this._toggles.forEach((e,i)=>{let a=new r;if(a.orientation=`horizontal`,a.className=`adw-toggle-button`,a.horizontalAlignment=`center`,e.icon){let n=new t;n.className=`${n.className} adw-toggle-icon`.trim(),n.verticalAlignment=`middle`,n.icon=e.icon,a.addChild(n)}let o=new n;o.text=e.label,o.className=`adw-toggle-label`,o.verticalAlignment=`middle`,a.addChild(o),a.addEventListener(`tap`,()=>{this._state.setSelected(i)}),this.addChild(a),this._segments.push(a)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get selected(){return this._state.selected}set selected(t){let n=e(t,this.selected);this._state.setSelected(n)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,o as NOTIFY_SELECTED,i as ToggleGroupState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{defaultToolbarViewProps as e,toolbarViewClassNames as t}from"./chrome.js";import{NO_INSETS as n,toolbarViewInsetPadding as r}from"./window-insets.js";import{observeWindowInsets as i}from"./window-insets-source.js";import{GridLayout as a,ItemSpec as o,StackLayout as s}from"@nativescript/core";const c={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`};var AdwToolbarView=class extends a{_topBox;_bottomBox;_content=null;_props=e();_insets=n;_topBarCount=0;_bottomBarCount=0;_detachInsets=null;constructor(){super(),this.className=c.view,this.addColumn(new o(1,`star`)),this.addRow(new o(1,`auto`)),this.addRow(new o(1,`star`)),this.addRow(new o(1,`auto`));let e=new s;e.orientation=`vertical`,e.className=c.topBar,a.setRow(e,0),this.addChild(e),this._topBox=e;let t=new s;t.orientation=`vertical`,t.className=c.bottomBar,a.setRow(t,2),this.addChild(t),this._bottomBox=t,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),this.addEventListener(`loaded`,()=>{this._detachInsets??=i(e=>this._applyInsets(e))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null})}addTopBar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}addBottomBar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}setContent(e){this._content&&=(this.removeChild(this._content),null),e&&(a.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}get content(){return this._content}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}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){this._props.extendContentToTopEdge=!!e,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(e){this._props.extendContentToBottomEdge=!!e,this._applyBarPlacement()}_applyBarPlacement(){a.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,a.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)}_applyInsets(e){this._insets=e;let t=r(e,{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0});this._topBox.paddingTop=t.topBarTop,this._bottomBox.paddingBottom=t.bottomBarBottom,this.paddingTop=t.contentTop,this.paddingBottom=t.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},n=t({view:this.className,topBar:this._topBox.className,bottomBar:this._bottomBox.className},this._props,e);this.className!==n.view&&(this.className=n.view),this._topBox.className!==n.topBar&&(this._topBox.className=n.topBar),this._bottomBox.className!==n.bottomBar&&(this._bottomBox.className=n.bottomBar)}};export{AdwToolbarView};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{resolveBuilderSlot as t}from"./builder-slots.js";import{defaultToolbarViewProps as n,toolbarViewClassNames as r}from"./chrome.js";import{NO_INSETS as i,insetsOwedBy as a,toolbarViewInsetPadding as o}from"./window-insets.js";import{resolveHostInsets as s}from"./host-insets.js";import{observeWindowInsets as c}from"./window-insets-source.js";import{GridLayout as l,ItemSpec as u,StackLayout as d}from"@nativescript/core";const f={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},p=[`topBar`,`bottomBar`,`content`];var AdwToolbarView=class extends l{_topBox;_bottomBox;_content=null;_props=n();_insets=i;_topBarCount=0;_bottomBarCount=0;_detachInsets=null;constructor(){super(),this.className=f.view,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addRow(new u(1,`star`)),this.addRow(new u(1,`auto`));let e=new d;e.orientation=`vertical`,e.className=f.topBar,l.setRow(e,0),this.addChild(e),this._topBox=e;let t=new d;t.orientation=`vertical`,t.className=f.bottomBar,l.setRow(t,2),this.addChild(t),this._bottomBox=t,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),this.addEventListener(`loaded`,()=>{this._detachInsets??=c(e=>this._applyInsets(e))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null})}addTopBar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}addBottomBar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}setContent(e){this._content&&=(this.removeChild(this._content),null),e&&(l.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,n){switch(t(e,p,`content`)){case`topBar`:this.addTopBar(n);return;case`bottomBar`:this.addBottomBar(n);return;default:this.setContent(n)}}get content(){return this._content}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}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(t){let n=e(t,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!n,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(t){let n=e(t,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!n,this._applyBarPlacement()}_applyBarPlacement(){l.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,l.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)}_applyInsets(e){this._insets=e;let t=o(a(e,s(this,e)),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0});this._topBox.paddingTop=t.topBarTop,this._bottomBox.paddingBottom=t.bottomBarBottom,this.paddingTop=t.contentTop,this.paddingBottom=t.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=r({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};