@gjsify/adwaita-nativescript 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/index.js +1 -1
- package/lib/esm/widgets/adw-action-row.js +1 -1
- package/lib/esm/widgets/adw-avatar.js +1 -1
- package/lib/esm/widgets/adw-button-content.js +1 -1
- package/lib/esm/widgets/adw-button-row.js +1 -1
- package/lib/esm/widgets/adw-combo-row.js +1 -1
- package/lib/esm/widgets/adw-expander-row.js +1 -1
- package/lib/esm/widgets/adw-icon.js +1 -1
- package/lib/esm/widgets/adw-image-button.js +1 -1
- package/lib/esm/widgets/adw-menu-button.js +1 -0
- package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
- package/lib/esm/widgets/adw-password-entry-row.js +1 -1
- package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
- package/lib/esm/widgets/adw-preferences-group.js +1 -1
- package/lib/esm/widgets/adw-spin-row.js +1 -1
- package/lib/esm/widgets/adw-split-button.js +1 -1
- package/lib/esm/widgets/adw-status-page.js +1 -1
- package/lib/esm/widgets/adw-tab-view.js +1 -1
- package/lib/esm/widgets/adw-toggle-group.js +1 -1
- package/lib/esm/widgets/adw-view-stack.js +1 -0
- package/lib/esm/widgets/adw-view-switcher-bar.js +1 -0
- package/lib/esm/widgets/breakpoint.js +1 -0
- package/lib/esm/widgets/color-scheme.js +1 -0
- package/lib/esm/widgets/index.js +1 -1
- package/lib/esm/widgets/split-view-base.js +1 -1
- package/lib/esm/widgets/view-switcher-base.js +1 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/widgets/adw-action-row.d.ts +11 -2
- package/lib/types/widgets/adw-avatar.d.ts +5 -0
- package/lib/types/widgets/adw-button-content.d.ts +11 -6
- package/lib/types/widgets/adw-button-row.d.ts +16 -6
- package/lib/types/widgets/adw-expander-row.d.ts +4 -3
- package/lib/types/widgets/adw-icon.d.ts +7 -1
- package/lib/types/widgets/adw-image-button.d.ts +6 -1
- package/lib/types/widgets/adw-menu-button.d.ts +32 -0
- package/lib/types/widgets/adw-password-entry-row.d.ts +8 -0
- package/lib/types/widgets/adw-preferences-group.d.ts +10 -0
- package/lib/types/widgets/adw-spin-row.d.ts +7 -6
- package/lib/types/widgets/adw-split-button.d.ts +23 -8
- package/lib/types/widgets/adw-status-page.d.ts +24 -6
- package/lib/types/widgets/adw-tab-view.d.ts +11 -0
- package/lib/types/widgets/adw-toggle-group.d.ts +16 -5
- package/lib/types/widgets/adw-view-stack.d.ts +46 -0
- package/lib/types/widgets/adw-view-switcher-bar.d.ts +29 -0
- package/lib/types/widgets/breakpoint.d.ts +69 -0
- package/lib/types/widgets/color-scheme.d.ts +22 -0
- package/lib/types/widgets/index.d.ts +9 -0
- package/lib/types/widgets/split-view-base.d.ts +8 -0
- package/lib/types/widgets/view-switcher-base.d.ts +17 -2
- package/package.json +6 -6
- package/src/theme/adwaita.css +281 -49
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{ADWAITA_SANS_FONT_FAMILY as
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{ADWAITA_SANS_FONT_FAMILY as ee,ADWAITA_SANS_TTF_FILES as e,adwaitaFontInstallInstructions as te,hasAdwaitaSans as t}from"./fonts.js";import{AdwPreferencesPage as n}from"./widgets/adw-preferences-page.js";import{AdwPreferencesGroup as r}from"./widgets/adw-preferences-group.js";import{AdwActionRow as i}from"./widgets/adw-action-row.js";import{AdwSwitchRow as a,NOTIFY_ACTIVE as o}from"./widgets/adw-switch-row.js";import{AdwEntryRow as s,NOTIFY_TEXT as c}from"./widgets/adw-entry-row.js";import{ADWAITA_ICON_GRID as l,DEFAULT_ICON_COLOR as u,DEFAULT_ICON_COLOR_DARK as d,extractIconPaths as f,extractPathData as p}from"./widgets/icon-path.js";import{adwaitaColorScheme as m,isThemeIconColor as h,onAdwaitaColorSchemeChanged as g,setAdwaitaColorScheme as _,themeIconColor as v,toggleAdwaitaColorScheme as y}from"./widgets/color-scheme.js";import{renderSymbolicIcon as b}from"./widgets/icons.js";import{attachRowPressFeedback as x}from"./widgets/row-press.js";import{AdwImageButton as S,DEFAULT_ICON_BUTTON_ICON_SIZE as C}from"./widgets/adw-image-button.js";import{AdwPasswordEntryRow as w}from"./widgets/adw-password-entry-row.js";import{AdwIcon as T,DEFAULT_ADW_ICON_SIZE as E}from"./widgets/adw-icon.js";import{AdwComboRow as D,NOTIFY_SELECTED as O}from"./widgets/adw-combo-row.js";import{AdwSpinRow as k,NOTIFY_VALUE as A}from"./widgets/adw-spin-row.js";import{AdwSliderRow as j,NOTIFY_SLIDER_VALUE as M}from"./widgets/adw-slider-row.js";import{AdwExpanderRow as N,NOTIFY_EXPANDED as P}from"./widgets/adw-expander-row.js";import{AdwButton as F}from"./widgets/adw-button.js";import{AdwMenuButton as I,MENU_ITEM_ACTIVATED as L}from"./widgets/adw-menu-button.js";import{AdwBanner as R,BUTTON_CLICKED as z}from"./widgets/adw-banner.js";import{AdwAvatar as B,DEFAULT_AVATAR_SIZE as V,avatarInitials as H}from"./widgets/adw-avatar.js";import{AdwWindowTitle as U}from"./widgets/adw-window-title.js";import{AdwClamp as W,DEFAULT_CLAMP_MAX_SIZE as G}from"./widgets/adw-clamp.js";import{AdwHeaderBar as K}from"./widgets/adw-header-bar.js";import{AdwToolbarView as q}from"./widgets/adw-toolbar-view.js";import{AdwWrapBox as J}from"./widgets/adw-wrap-box.js";import{AdwSpinner as Y,DEFAULT_SPINNER_SIZE as X}from"./widgets/adw-spinner.js";import{AdwStatusPage as Z}from"./widgets/adw-status-page.js";import{ACTIVATED as ne,AdwButtonRow as re}from"./widgets/adw-button-row.js";import{AdwButtonContent as Q}from"./widgets/adw-button-content.js";import{AdwSplitButton as ie,CLICKED as ae,MENU_TAPPED as oe}from"./widgets/adw-split-button.js";import{AdwToggleGroup as se,NOTIFY_SELECTED as ce}from"./widgets/adw-toggle-group.js";import{AdwViewStack as le,NOTIFY_VISIBLE_CHILD as ue}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as de,NOTIFY_SELECTED as fe}from"./widgets/view-switcher-base.js";import{AdwViewSwitcher as pe}from"./widgets/adw-view-switcher.js";import{AdwViewSwitcherBar as me}from"./widgets/adw-view-switcher-bar.js";import{AdwInlineViewSwitcher as he}from"./widgets/adw-inline-view-switcher.js";import{AdwTabView as ge}from"./widgets/adw-tab-view.js";import{AdwCarousel as _e,DEFAULT_CAROUSEL_PAGE_WIDTH as ve,NOTIFY_POSITION as ye}from"./widgets/adw-carousel.js";import{AdwNavigationView as be,NOTIFY_VISIBLE_PAGE as xe}from"./widgets/adw-navigation-view.js";import{AdwSplitViewBase as Se,DEFAULT_SIDEBAR_WIDTH as Ce,NOTIFY_SHOW_SIDEBAR as we}from"./widgets/split-view-base.js";import{AdwNavigationSplitView as Te}from"./widgets/adw-navigation-split-view.js";import{AdwOverlaySplitView as Ee}from"./widgets/adw-overlay-split-view.js";import{AdwSidebar as De,NOTIFY_SELECTED as Oe}from"./widgets/adw-sidebar.js";import{AdwBottomSheet as ke,NOTIFY_OPEN as Ae}from"./widgets/adw-bottom-sheet.js";import{AdwToast as je,AdwToastOverlay as Me,DEFAULT_TOAST_TIMEOUT as Ne,TOAST_BUTTON_CLICKED as Pe}from"./widgets/adw-toast-overlay.js";import{AdwAlertDialog as Fe,NOTIFY_RESPONSE as Ie}from"./widgets/adw-alert-dialog.js";import{AdwAboutDialog as Le,CLOSED as Re}from"./widgets/adw-about-dialog.js";import{AdwPreferencesDialog as ze,CLOSED as Be}from"./widgets/adw-preferences-dialog.js";import{AdwBreakpoint as Ve,addBreakpoints as He,evaluateBreakpointCondition as Ue,parseBreakpointCondition as We}from"./widgets/breakpoint.js";import{registerAdwaitaElements as $}from"./widgets/index.js";import{assertNativeScript as Ge,assertNativeScript as Ke,isAndroid as qe,isIOS as Je,isNativeScript as Ye}from"@gjsify/native-platform";function registerAdwaita(){Ke(),$()}export{Re as ABOUT_CLOSED,ne as ACTIVATED,l as ADWAITA_ICON_GRID,ee as ADWAITA_SANS_FONT_FAMILY,e as ADWAITA_SANS_TTF_FILES,Le as AdwAboutDialog,i as AdwActionRow,Fe as AdwAlertDialog,B as AdwAvatar,R as AdwBanner,ke as AdwBottomSheet,Ve as AdwBreakpoint,F as AdwButton,Q as AdwButtonContent,re as AdwButtonRow,_e as AdwCarousel,W as AdwClamp,D as AdwComboRow,s as AdwEntryRow,N as AdwExpanderRow,K as AdwHeaderBar,T as AdwIcon,S as AdwImageButton,he as AdwInlineViewSwitcher,I as AdwMenuButton,Te as AdwNavigationSplitView,be as AdwNavigationView,Ee as AdwOverlaySplitView,w as AdwPasswordEntryRow,ze as AdwPreferencesDialog,r as AdwPreferencesGroup,n as AdwPreferencesPage,De as AdwSidebar,j as AdwSliderRow,k as AdwSpinRow,Y as AdwSpinner,ie as AdwSplitButton,Se as AdwSplitViewBase,Z as AdwStatusPage,a as AdwSwitchRow,ge as AdwTabView,je as AdwToast,Me as AdwToastOverlay,se as AdwToggleGroup,q as AdwToolbarView,le as AdwViewStack,pe as AdwViewSwitcher,me as AdwViewSwitcherBar,de as AdwViewSwitcherBase,U as AdwWindowTitle,J as AdwWrapBox,z as BUTTON_CLICKED,ae as CLICKED,E as DEFAULT_ADW_ICON_SIZE,V as DEFAULT_AVATAR_SIZE,ve as DEFAULT_CAROUSEL_PAGE_WIDTH,G as DEFAULT_CLAMP_MAX_SIZE,C as DEFAULT_ICON_BUTTON_ICON_SIZE,u as DEFAULT_ICON_COLOR,d as DEFAULT_ICON_COLOR_DARK,Ce as DEFAULT_SIDEBAR_WIDTH,X as DEFAULT_SPINNER_SIZE,Ne as DEFAULT_TOAST_TIMEOUT,L as MENU_ITEM_ACTIVATED,oe as MENU_TAPPED,o as NOTIFY_ACTIVE,P as NOTIFY_EXPANDED,Ae as NOTIFY_OPEN,ye as NOTIFY_POSITION,Ie as NOTIFY_RESPONSE,O as NOTIFY_SELECTED,we as NOTIFY_SHOW_SIDEBAR,Oe as NOTIFY_SIDEBAR_SELECTED,M as NOTIFY_SLIDER_VALUE,c as NOTIFY_TEXT,ce as NOTIFY_TOGGLE_SELECTED,A as NOTIFY_VALUE,fe as NOTIFY_VIEW_SELECTED,ue as NOTIFY_VISIBLE_CHILD,xe as NOTIFY_VISIBLE_PAGE,Be as PREFERENCES_CLOSED,Pe as TOAST_BUTTON_CLICKED,He as addBreakpoints,m as adwaitaColorScheme,te as adwaitaFontInstallInstructions,Ge as assertNativeScript,x as attachRowPressFeedback,H as avatarInitials,Ue as evaluateBreakpointCondition,f as extractIconPaths,p as extractPathData,t as hasAdwaitaSans,qe as isAndroid,Je as isIOS,Ye as isNativeScript,h as isThemeIconColor,g as onAdwaitaColorSchemeChanged,We as parseBreakpointCondition,registerAdwaita,$ as registerAdwaitaElements,b as renderSymbolicIcon,_ as setAdwaitaColorScheme,v as themeIconColor,y as toggleAdwaitaColorScheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t,Label as n,StackLayout as r}from"@nativescript/core";var AdwActionRow=class extends e{_textStack;_titleLabel;_subtitleLabel;_hasSubtitle=!1;_suffix=null;constructor(){super(),this.className=`adw-row adw-action-row`,this.addColumn(new t(1,`star`)),this.addColumn(new t(1,`auto`)),this.addRow(new t(1,`auto`));let i=new r;i.orientation=`vertical`,i.className=`adw-row-text`,e.setColumn(i,
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t,Label as n,StackLayout as r}from"@nativescript/core";var AdwActionRow=class extends e{_textStack;_titleLabel;_subtitleLabel;_hasSubtitle=!1;_prefix=null;_suffix=null;constructor(){super(),this.className=`adw-row adw-action-row`,this.addColumn(new t(1,`auto`)),this.addColumn(new t(1,`star`)),this.addColumn(new t(1,`auto`)),this.addRow(new t(1,`auto`));let i=new r;i.orientation=`vertical`,i.className=`adw-row-text`,e.setColumn(i,1);let a=new n;a.className=`adw-row-title`,a.textWrap=!0,i.addChild(a);let o=new n;o.className=`adw-row-subtitle`,o.textWrap=!0,this.addChild(i),this._textStack=i,this._titleLabel=a,this._subtitleLabel=o}setPrefix(t){this._prefix&&=(this.removeChild(this._prefix),null),t&&(t.className=`${t.className??``} adw-row-prefix`.trim(),e.setColumn(t,0),this.addChild(t),this._prefix=t)}get prefix(){return this._prefix}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get subtitle(){return this._hasSubtitle?this._subtitleLabel.text??``:``}set subtitle(e){let t=e??``;this._subtitleLabel.text=t;let n=t.length>0;n&&!this._hasSubtitle?(this._textStack.addChild(this._subtitleLabel),this._hasSubtitle=!0):!n&&this._hasSubtitle&&(this._textStack.removeChild(this._subtitleLabel),this._hasSubtitle=!1)}setSuffix(t){this._suffix&&=(this.removeChild(this._suffix),null),t&&(t.className=`${t.className??``} adw-row-suffix`.trim(),e.setColumn(t,2),this.addChild(t),this._suffix=t)}get suffix(){return this._suffix}};export{AdwActionRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t,Label as n}from"@nativescript/core";const r=48;function avatarInitials(e){let t=(e??``).trim().split(/\s+/).filter(Boolean);return t.length===0?``:t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var AdwAvatar=class extends e{_label;_text=``;_size=48;constructor(){super(),this.className=`adw-avatar`,this.addColumn(new t(1,`star`)),this.addRow(new t(1,`star`));let r=new n;r.className=`adw-avatar-label`,r.horizontalAlignment=`center`,r.verticalAlignment=`middle`,e.setColumn(r,0),e.setRow(r,0),this.addChild(r),this._label=r,this._applySize()}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(this._size*.4))}get text(){return this._text}set text(e){this._text=e??``,this._label.text=avatarInitials(this._text)}get size(){return this._size}set size(e){this._size=Number.isFinite(e)&&e>0?e:48,this._applySize()}};export{AdwAvatar,r as DEFAULT_AVATAR_SIZE,avatarInitials};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t,Label as n}from"@nativescript/core";const r=48,i=[{fg:`#cfe1f5`,start:`#83b6ec`,stop:`#337fdc`},{fg:`#caeaf2`,start:`#7ad9f1`,stop:`#0f9ac8`},{fg:`#cef8d8`,start:`#8de6b1`,stop:`#29ae74`},{fg:`#e6f9d7`,start:`#b5e98a`,stop:`#6ab85b`},{fg:`#f9f4e1`,start:`#f8e359`,stop:`#d29d09`},{fg:`#ffead1`,start:`#ffcb62`,stop:`#d68400`},{fg:`#ffe5c5`,start:`#ffa95a`,stop:`#ed5b00`},{fg:`#f8d2ce`,start:`#f78773`,stop:`#e62d42`},{fg:`#fac7de`,start:`#e973ab`,stop:`#e33b6a`},{fg:`#e7c2e8`,start:`#cb78d4`,stop:`#9945b5`},{fg:`#d5d2f5`,start:`#9e91e8`,stop:`#7a59ca`},{fg:`#f2eade`,start:`#e3cf9c`,stop:`#b08952`},{fg:`#e5d6ca`,start:`#be916d`,stop:`#785336`},{fg:`#d8d7d3`,start:`#c0bfbc`,stop:`#6e6d71`}];function gStrHash(e){let t=5381;for(let n=0;n<e.length;n++)t=Math.imul(t,33)+e.charCodeAt(n)>>>0;return t>>>0}function blendHex(e,t){let n=Number.parseInt(e.slice(1),16),r=Number.parseInt(t.slice(1),16),mix=e=>Math.round(((n>>e&255)+(r>>e&255))/2).toString(16).padStart(2,`0`);return`#${mix(16)}${mix(8)}${mix(0)}`}function avatarColor(e){let t=i[gStrHash(e??``)%i.length];return{fill:blendHex(t.start,t.stop),fg:t.fg}}function avatarInitials(e){let t=(e??``).trim().split(/\s+/).filter(Boolean);return t.length===0?``:t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var AdwAvatar=class extends e{_label;_text=``;_size=48;constructor(){super(),this.className=`adw-avatar`,this.addColumn(new t(1,`star`)),this.addRow(new t(1,`star`));let r=new n;r.className=`adw-avatar-label`,r.horizontalAlignment=`center`,r.verticalAlignment=`middle`,e.setColumn(r,0),e.setRow(r,0),this.addChild(r),this._label=r,this._applySize()}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(this._size*.4))}get text(){return this._text}set text(e){this._text=e??``,this._label.text=avatarInitials(this._text);let{fill:t,fg:n}=avatarColor(this._text);this.set(`backgroundColor`,t),this._label.set(`color`,n)}get size(){return this._size}set size(e){this._size=Number.isFinite(e)&&e>0?e:48,this._applySize()}};export{AdwAvatar,r as DEFAULT_AVATAR_SIZE,avatarColor,avatarInitials};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{Label as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{Label as t,StackLayout as n}from"@nativescript/core";var AdwButtonContent=class extends n{_icon;_label;_hasIcon=!1;_iconSvg=``;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-button-content`,this.horizontalAlignment=`center`;let n=new e;n.className=`${n.className} adw-button-content-icon`.trim(),n.verticalAlignment=`middle`,this._icon=n;let r=new t;r.className=`adw-button-content-label`,r.verticalAlignment=`middle`,this.addChild(r),this._label=r}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._icon.icon=this._iconSvg;let t=this._iconSvg.length>0;t&&!this._hasIcon?(this.removeChild(this._label),this.addChild(this._icon),this.addChild(this._label),this._hasIcon=!0):!t&&this._hasIcon&&(this.removeChild(this._icon),this._hasIcon=!1)}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get label(){return this._label.text??``}set label(e){this._label.text=e??``}};export{AdwButtonContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{attachRowPressFeedback as t}from"./row-press.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{attachRowPressFeedback as t}from"./row-press.js";import{AdwIcon as n}from"./adw-icon.js";import{StackLayout as r}from"@nativescript/core";const i=`#3584e4`,a=`activated`;var AdwButtonRow=class extends e{_contentBox;_startIcon;_hasStartIcon=!1;_startIconSvg=``;constructor(){super(),this.className=`adw-row adw-action-row adw-button-row`,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,this._textStack.removeChild(this._titleLabel);let e=new r;e.orientation=`horizontal`,e.className=`adw-button-row-content`,e.horizontalAlignment=`center`;let o=new n;o.className=`${o.className} adw-button-row-start-icon`.trim(),o.verticalAlignment=`middle`,o.iconColor=i,e.addChild(this._titleLabel),this._textStack.addChild(e),this._textStack.horizontalAlignment=`center`,this._contentBox=e,this._startIcon=o,this.addEventListener(`tap`,()=>{let e={eventName:a,object:this};this.notify(e)}),t(this)}get startIcon(){return this._startIconSvg}set startIcon(e){this._startIconSvg=e??``,this._startIcon.icon=this._startIconSvg;let t=this._startIconSvg.length>0;t&&!this._hasStartIcon?(this._contentBox.removeChild(this._titleLabel),this._contentBox.addChild(this._startIcon),this._contentBox.addChild(this._titleLabel),this._hasStartIcon=!0):!t&&this._hasStartIcon&&(this._contentBox.removeChild(this._startIcon),this._hasStartIcon=!1)}get startIconColor(){return this._startIcon.iconColor}set startIconColor(e){this._startIcon.iconColor=e||i}};export{a as ACTIVATED,AdwButtonRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{attachRowPressFeedback as t}from"./row-press.js";import{AdwIcon as n}from"./adw-icon.js";import{Label as r,StackLayout as i,action as a}from"@nativescript/core";import{panDownSymbolic as o}from"@gjsify/adwaita-icons/ui";const s=`notify::selected`;var AdwComboRow=class extends e{_valueLabel;_chevron;_options=[];_selectedIndex=0;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 s=new n;s.className=`adw-combo-chevron`,s.iconColor=`#9a9a9a`,s.iconSize=16,s.icon=o,e.addChild(a),e.addChild(s),this.setSuffix(e),this._valueLabel=a,this._chevron=s,this.addEventListener(`tap`,()=>{this._openChooser()}),t(this)}async _openChooser(){if(this._options.length===0)return;let e=this._options.map(e=>e.label),t=await a({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e}),n=e.indexOf(t);n>=0&&n!==this._selectedIndex&&(this.selectedIndex=n,this._emitSelected())}_syncValueLabel(){this._valueLabel.text=this._options[this._selectedIndex]?.label??``}_emitSelected(){let e={eventName:s,object:this,selected:this._selectedIndex,value:this.selectedValue};this.notify(e)}get options(){return this._options}set options(e){this._options=Array.isArray(e)?e:[],this._selectedIndex>=this._options.length&&(this._selectedIndex=0),this._syncValueLabel()}get selectedIndex(){return this._selectedIndex}set selectedIndex(e){let t=Number.isFinite(e)?e:0;t!==this._selectedIndex&&(this._selectedIndex=t,this._syncValueLabel())}get selectedValue(){return this._options[this._selectedIndex]?.value??``}set selectedValue(e){let t=this._options.findIndex(t=>t.value===e);t>=0&&(this.selectedIndex=t)}};export{AdwComboRow,s as NOTIFY_SELECTED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwActionRow as e}from"./adw-action-row.js";import{
|
|
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{panDownSymbolic as a,panUpSymbolic as o}from"@gjsify/adwaita-icons/ui";const s=`notify::expanded`;var AdwExpanderRow=class extends e{_toggle;_disclosure;_expanded=!1;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 o=new t;o.icon=a,o.className=`${o.className} adw-expander-toggle`.trim(),this.setSuffix(o),this._toggle=o,o.addEventListener(`tap`,()=>{this.expanded=!this._expanded})}addRow(e){if(e instanceof r){super.addRow(e);return}this._disclosure.addChild(e)}removeRow(e){this._disclosure.removeChild(e)}get expanded(){return this._expanded}set expanded(e){let t=!!e;if(t===this._expanded)return;this._expanded=t,this._disclosure.visibility=t?`visible`:`collapse`,this._toggle.icon=t?o:a;let n={eventName:s,object:this,expanded:t};this.notify(n)}};export{AdwExpanderRow,s as NOTIFY_EXPANDED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import"./icon-path.js";import{onAdwaitaColorSchemeChanged as e,themeIconColor as t}from"./color-scheme.js";import{renderSymbolicIcon as n}from"./icons.js";import{Image as r}from"@nativescript/core";const i=16;var AdwIcon=class extends r{_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=n(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||`#33333A`,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,i as DEFAULT_ADW_ICON_SIZE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import"./icon-path.js";import{onAdwaitaColorSchemeChanged as e,themeIconColor as t}from"./color-scheme.js";import{renderSymbolicIcon as n}from"./icons.js";import{attachRowPressFeedback as r}from"./row-press.js";import{GridLayout as i,Image as a,ItemSpec as o}from"@nativescript/core";const s=16;var AdwImageButton=class extends i{_image;_iconSvg=``;_iconColor=t();_explicitColor=!1;_iconSize=16;_unsubScheme=null;constructor(){super(),this.className=`adw-image-button`,this.addRow(new o(1,`star`)),this.addColumn(new o(1,`star`));let t=new a;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,r(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=n(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||`#33333A`,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,s as DEFAULT_ICON_BUTTON_ICON_SIZE};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwImageButton as e}from"./adw-image-button.js";import{action as t}from"@nativescript/core";const n=`menuItemActivated`;var AdwMenuButton=class extends e{_items=[];_menuTitle=``;constructor(){super(),this.className=`${this.className} adw-menu-button`.trim(),this.addEventListener(`tap`,()=>{this._openMenu()})}get menuItems(){return this._items}set menuItems(e){this._items=Array.isArray(e)?e:[]}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}async _openMenu(){if(this._items.length===0)return;let e=this._items.map(e=>e.label),r=await t({title:this._menuTitle||void 0,cancelButtonText:`Cancel`,actions:e}),i=e.indexOf(r);if(i<0)return;let a=this._items[i],o={eventName:n,object:this,id:a.id??a.label,label:a.label,index:i};this.notify(o)}};export{AdwMenuButton,n as MENU_ITEM_ACTIVATED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwSplitViewBase as e}from"./split-view-base.js";import{GridLayout as t}from"@nativescript/core";var AdwOverlaySplitView=class extends e{_scrim=null;constructor(){super(`adw-overlay-split-view`),this._applyLayout()}_applyLayout(){let e=this._sidebarPosition===`end`;if(!this._collapsed){this._detachScrim()
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwSplitViewBase as e}from"./split-view-base.js";import{GridLayout as t}from"@nativescript/core";var AdwOverlaySplitView=class extends e{_scrim=null;constructor(){super(`adw-overlay-split-view`),this._applyLayout()}_applyLayout(){let e=this._sidebarPosition===`end`;if(!this._collapsed){this._detachScrim();let n=this._showSidebar;this._sidebar&&(this._sidebar.visibility=n?`visible`:`collapse`,this._sidebar.translateX=0,this._sidebar.opacity=1,t.setColumn(this._sidebar,+!!e),t.setColumnSpan(this._sidebar,1),this._sidebar.width=this._sidebarWidth),this._content&&(this._content.visibility=`visible`,t.setColumn(this._content,n?+!e:0),t.setColumnSpan(this._content,n?1:2));return}this._content&&(this._content.visibility=`visible`,t.setColumn(this._content,0),t.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(t.setColumn(this._scrim,0),t.setColumnSpan(this._scrim,2),this._scrim.visibility=this._showSidebar?`visible`:`collapse`,this._scrim.opacity=+!!this._showSidebar),this._sidebar&&(t.setColumn(this._sidebar,0),t.setColumnSpan(this._sidebar,2),this._sidebar.width=this._sidebarWidth,this._sidebar.horizontalAlignment=e?`right`:`left`,this._sidebar.className=`${this._stripOverlay(this._sidebar.className)} adw-split-view-sidebar adw-overlay-active`.trim(),this._sidebar.visibility=this._showSidebar?`visible`:`collapse`,this._sidebar.translateX=this._showSidebar?0:this._hiddenOffset(),this._sidebar.opacity=1)}_transitionSidebar(){if(!this._collapsed||!this._shouldAnimate()){this._applyLayout();return}this._cancelPending(),this._prepareCollapsedStructure(),this._showSidebar?this._animateOpen():this._animateClose()}_ensureScrim(){if(this._scrim)return this._scrim;let e=new t;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._sidebarPosition===`end`;this._content&&(this._content.visibility=`visible`,t.setColumn(this._content,0),t.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(t.setColumn(this._scrim,0),t.setColumnSpan(this._scrim,2)),this._sidebar&&(t.setColumn(this._sidebar,0),t.setColumnSpan(this._sidebar,2),this._sidebar.width=this._sidebarWidth,this._sidebar.horizontalAlignment=e?`right`:`left`,this._sidebar.className=`${this._stripOverlay(this._sidebar.className)} adw-split-view-sidebar adw-overlay-active`.trim())}_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._showSidebar||(t&&(t.visibility=`collapse`),e&&(e.visibility=`collapse`))}).catch(()=>{})}_hiddenOffset(){return this._sidebarPosition===`end`?this._sidebarWidth:-this._sidebarWidth}_stripOverlay(e){return(e??``).split(/\s+/).filter(e=>e&&e!==`adw-overlay-active`&&e!==`adw-split-view-sidebar`).join(` `)}};export{AdwOverlaySplitView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwEntryRow as e}from"./adw-entry-row.js";var AdwPasswordEntryRow=class extends e{constructor(){super(),this.className=`adw-row adw-action-row adw-entry-row adw-password-entry-row`,this._field.className=`adw-entry-field adw-password-field`,this._field.secure=!0}};export{AdwPasswordEntryRow};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwEntryRow as e}from"./adw-entry-row.js";import{AdwImageButton as t}from"./adw-image-button.js";import{viewConcealSymbolic as n,viewRevealSymbolic as r}from"@gjsify/adwaita-icons/actions";var AdwPasswordEntryRow=class extends e{_peekButton;constructor(){super(),this.className=`adw-row adw-action-row adw-entry-row adw-password-entry-row`,this._field.className=`adw-entry-field adw-password-field`,this._field.secure=!0;let e=new t;e.className=`${e.className} adw-password-peek`.trim(),e.icon=r,e.addEventListener(`tap`,()=>this._togglePeek()),this.setSuffix(e),this._peekButton=e}_togglePeek(){this._field.secure=!this._field.secure,this._peekButton.icon=this._field.secure?r:n}get peeking(){return!this._field.secure}set peeking(e){let t=!!e;t!==this.peeking&&(this._field.secure=!t,this._peekButton.icon=this._field.secure?r:n)}};export{AdwPasswordEntryRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwImageButton as e}from"./adw-image-button.js";import{GridLayout as t,ItemSpec as n,Label as r,StackLayout as i}from"@nativescript/core";import{windowCloseSymbolic as a}from"@gjsify/adwaita-icons/ui";const o=`closed`;var AdwPreferencesDialog=class extends t{_card;_headerBox;_titleLabel;_body;constructor(){super(),this.className=`adw-preferences-dialog`,this.visibility=`collapse`,this.addColumn(new n(1,`star`)),this.addRow(new n(1,`star`));let o=new t;o.className=`adw-preferences-dialog-card`,o.verticalAlignment=`middle`,o.horizontalAlignment=`center`,o.addColumn(new n(1,`star`)),o.addRow(new n(1,`auto`)),o.addRow(new n(1,`star`)),t.setColumn(o,0),t.setRow(o,0),this.addChild(o),this._card=o;let s=new t;s.className=`adw-preferences-dialog-header`,s.addColumn(new n(1,`star`)),s.addColumn(new n(1,`auto`)),s.addRow(new n(1,`auto`)),t.setRow(s,0),o.addChild(s),this._headerBox=s;let c=new r;c.className=`adw-preferences-dialog-title`,c.text=`Preferences`,t.setColumn(c,0),s.addChild(c),this._titleLabel=c;let l=new e;l.icon=a,l.className=`${l.className} adw-preferences-dialog-close`.trim(),l.addEventListener(`tap`,()=>this.close()),t.setColumn(l,1),s.addChild(l);let u=new i;u.orientation=`vertical`,u.className=`adw-preferences-dialog-body`,t.setRow(u,1),o.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)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:o,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,o as CLOSED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{Label as e,StackLayout as t}from"@nativescript/core";var AdwPreferencesGroup=class extends t{_titleLabel;_hasTitle=!1;_listbox;constructor(){super(),this.orientation=`vertical`,this.className=`adw-preferences-group`;let n=new e;n.className=`adw-preferences-group-title`,n.textWrap=!0;let r=new t;r.orientation=`vertical`,r.className=`boxed-list adw-preferences-group-listbox`,this.addChild(r),this._titleLabel=n,this._listbox=r}get title(){return this._hasTitle?this._titleLabel.text??``:``}set title(e){let t=e??``;this._titleLabel.text=t;let n=t.length>0;n&&!this._hasTitle?(this.removeChild(this._listbox),this.addChild(this._titleLabel),this.addChild(this._listbox),this._hasTitle=!0):!n&&this._hasTitle&&(this.removeChild(this._titleLabel),this._hasTitle=!1)}addRow(e){this._listbox.addChild(e)}removeRow(e){this._listbox.removeChild(e)}get listbox(){return this._listbox}};export{AdwPreferencesGroup};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{Label as e,StackLayout as t}from"@nativescript/core";var AdwPreferencesGroup=class extends t{_titleLabel;_hasTitle=!1;_listbox;constructor(){super(),this.orientation=`vertical`,this.className=`adw-preferences-group`;let n=new e;n.className=`adw-preferences-group-title`,n.textWrap=!0;let r=new t;r.orientation=`vertical`,r.className=`boxed-list adw-preferences-group-listbox`,this.addChild(r),this._titleLabel=n,this._listbox=r}get title(){return this._hasTitle?this._titleLabel.text??``:``}set title(e){let t=e??``;this._titleLabel.text=t;let n=t.length>0;n&&!this._hasTitle?(this.removeChild(this._listbox),this.addChild(this._titleLabel),this.addChild(this._listbox),this._hasTitle=!0):!n&&this._hasTitle&&(this.removeChild(this._titleLabel),this._hasTitle=!1)}addRow(e){this._listbox.addChild(e),this._refreshRowEdges()}removeRow(e){this._listbox.removeChild(e),this._refreshRowEdges()}_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{AdwActionRow as e}from"./adw-action-row.js";import{
|
|
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{valueDecreaseSymbolic as i,valueIncreaseSymbolic as a}from"@gjsify/adwaita-icons/actions";const o=`notify::value`;var AdwSpinRow=class extends e{_minusButton;_plusButton;_valueLabel;_value=0;_min=0;_max=100;_step=1;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 o=new n;o.className=`adw-spin-value`,o.text=String(this._value);let s=new t;s.icon=i,s.className=`${s.className} adw-spin-button adw-spin-minus`.trim();let c=new t;c.icon=a,c.className=`${c.className} adw-spin-button adw-spin-plus`.trim(),e.addChild(o),e.addChild(s),e.addChild(c),this.setSuffix(e),this._minusButton=s,this._plusButton=c,this._valueLabel=o,s.addEventListener(`tap`,()=>this._bump(-this._step)),c.addEventListener(`tap`,()=>this._bump(this._step))}_bump(e){let t=this._clamp(this._value+e);if(t!==this._value){this._value=t,this._valueLabel.text=String(t);let e={eventName:o,object:this,value:t};this.notify(e)}}_clamp(e){return Math.min(this._max,Math.max(this._min,e))}get value(){return this._value}set value(e){let t=this._clamp(Number.isFinite(e)?e:0);t!==this._value&&(this._value=t,this._valueLabel.text=String(t))}get min(){return this._min}set min(e){this._min=Number.isFinite(e)?e:0,this.value=this._value}get max(){return this._max}set max(e){this._max=Number.isFinite(e)?e:0,this.value=this._value}get step(){return this._step}set step(e){this._step=Number.isFinite(e)&&e>0?e:1}};export{AdwSpinRow,o as NOTIFY_VALUE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{attachRowPressFeedback as e}from"./row-press.js";import{AdwIcon as t}from"./adw-icon.js";import{GridLayout as n,ItemSpec as r,Label as i,StackLayout as a,action as o}from"@nativescript/core";import{panDownSymbolic as s}from"@gjsify/adwaita-icons/ui";const c=`clicked`,l=`menuTapped`;var AdwSplitButton=class extends n{_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_menu=[];_hasActionIcon=!1;_actionIconSvg=``;constructor(){super(),this.className=`adw-split-button`,this.addColumn(new r(1,`auto`)),this.addColumn(new r(1,`auto`)),this.addRow(new r(1,`auto`));let o=new a;o.orientation=`horizontal`,o.className=`adw-split-button-action`,o.horizontalAlignment=`center`,n.setColumn(o,0);let l=new i;l.className=`adw-split-button-label`,l.verticalAlignment=`middle`,o.addChild(l);let u=new t;u.className=`${u.className} adw-split-button-action-icon`.trim(),u.verticalAlignment=`middle`,this.addChild(o),this._actionPart=o,this._actionLabel=l,this._actionIcon=u;let d=new n;d.className=`adw-split-button-dropdown`,d.addColumn(new r(1,`star`)),d.addRow(new r(1,`star`)),n.setColumn(d,1);let f=new t;f.className=`${f.className} adw-split-button-chevron`.trim(),f.icon=s,f.horizontalAlignment=`center`,f.verticalAlignment=`middle`,d.addChild(f),this.addChild(d),this._dropdownPart=d,this._chevron=f,o.addEventListener(`tap`,()=>{let e={eventName:c,object:this};this.notify(e)}),d.addEventListener(`tap`,()=>{this._openMenu()}),e(o),e(d)}async _openMenu(){if(this._menu.length===0)return;let e=await o({title:this.label||void 0,cancelButtonText:`Cancel`,actions:this._menu}),t=this._menu.indexOf(e);if(t>=0){let n={eventName:l,object:this,item:e,index:t};this.notify(n)}}get label(){return this._actionLabel.text??``}set label(e){this._actionLabel.text=e??``}get actionIcon(){return this._actionIconSvg}set actionIcon(e){this._actionIconSvg=e??``,this._actionIcon.icon=this._actionIconSvg;let t=this._actionIconSvg.length>0;t&&!this._hasActionIcon?(this._actionPart.removeChild(this._actionLabel),this._actionPart.addChild(this._actionIcon),this._hasActionIcon=!0):!t&&this._hasActionIcon&&(this._actionPart.removeChild(this._actionIcon),this._actionPart.addChild(this._actionLabel),this._hasActionIcon=!1)}get menu(){return this._menu}set menu(e){this._menu=Array.isArray(e)?e:[]}get actionButton(){return this._actionPart}};export{AdwSplitButton,c as CLICKED,l as MENU_TAPPED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{GridLayout as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{GridLayout as t,ItemSpec as n,Label as r,StackLayout as i}from"@nativescript/core";var AdwStatusPage=class extends t{_stack;_icon;_iconSvg=``;_iconLabel;_iconGlyph=``;_iconNode=null;_titleLabel;_descriptionLabel;_hasDescription=!1;_child=null;constructor(){super(),this.className=`adw-status-page`,this.addColumn(new n(1,`star`)),this.addRow(new n(1,`star`));let a=new i;a.orientation=`vertical`,a.className=`adw-status-page-content`,a.horizontalAlignment=`center`,a.verticalAlignment=`middle`,t.setColumn(a,0),t.setRow(a,0),this.addChild(a),this._stack=a;let o=new e;o.className=`${o.className} adw-status-page-icon`.trim(),o.horizontalAlignment=`center`,o.iconColor=`#9b9b9b`,o.iconSize=96,this._icon=o;let s=new r;s.className=`adw-status-page-icon-glyph`,s.horizontalAlignment=`center`,this._iconLabel=s;let c=new r;c.className=`adw-status-page-title`,c.horizontalAlignment=`center`,c.textWrap=!0,a.addChild(c),this._titleLabel=c;let l=new r;l.className=`adw-status-page-description`,l.horizontalAlignment=`center`,l.textWrap=!0,this._descriptionLabel=l}get icon(){return this._iconSvg}set icon(e){this._iconSvg=e??``,this._icon.icon=this._iconSvg,this._setIconNode(this._iconSvg.length>0?this._icon:null)}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._setIconNode(this._iconGlyph.length>0?this._iconLabel:null)}_setIconNode(e){this._iconNode!==e&&(this._iconNode&&this._stack.removeChild(this._iconNode),this._iconNode=e,e&&(this._stack.removeChild(this._titleLabel),this._hasDescription&&this._stack.removeChild(this._descriptionLabel),this._child&&this._stack.removeChild(this._child),this._stack.addChild(e),this._stack.addChild(this._titleLabel),this._hasDescription&&this._stack.addChild(this._descriptionLabel),this._child&&this._stack.addChild(this._child)))}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get description(){return this._hasDescription?this._descriptionLabel.text??``:``}set description(e){let t=e??``;this._descriptionLabel.text=t;let n=t.length>0;n&&!this._hasDescription?(this._child&&this._stack.removeChild(this._child),this._stack.addChild(this._descriptionLabel),this._child&&this._stack.addChild(this._child),this._hasDescription=!0):!n&&this._hasDescription&&(this._stack.removeChild(this._descriptionLabel),this._hasDescription=!1)}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 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwImageButton as e}from"./adw-image-button.js";import{AdwViewSwitcherBase as t}from"./view-switcher-base.js";import{windowCloseSymbolic as n}from"@gjsify/adwaita-icons/ui";var AdwTabView=class extends t{_closeButtons=[];constructor(){super(`adw-tab-view`),this._initClasses(),this._bar.horizontalAlignment=`stretch`}get barClass(){return`adw-tab-view-bar`}get buttonClass(){return`adw-tab-view-tab`}_buildButtonExtras(t,r,i){let a=new e;a.className=`${a.className} adw-tab-close`.trim(),a.icon=n,a.iconSize=12,a.verticalAlignment=`middle`,a.addEventListener(`tap`,()=>this._closeTab(i)),t.addChild(a),this._closeButtons[i]=a}_applyButtonState(e,t,n){let r=this._closeButtons[t];r&&(r.visibility=n?`visible`:`collapse`)}_closeTab(e){if(this._pages.length<=1)return;let t=this._pages.filter((t,n)=>n!==e);(e<this._selected||this._selected>=t.length)&&(this._selected=Math.max(0,this._selected-1)),this.setViews(t)}setViews(e){this._closeButtons.length=0,super.setViews(e)}get tabs(){return this.views}set tabs(e){this.views=e}};export{AdwTabView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{Label as t,StackLayout as n}from"@nativescript/core";const r=`notify::selected`;var AdwToggleGroup=class extends n{_toggles=[];_segments=[];_selected=0;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`}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.selected=i}),this.addChild(a),this._segments.push(a)}),this._selected>=this._toggles.length&&(this._selected=0),this._applySelection()}_applySelection(){this._segments.forEach((e,t)=>{e.className=t===this._selected?`adw-toggle-button active`:`adw-toggle-button`})}get selected(){return this._selected}set selected(e){let t=Number.isFinite(e)?e:0;if(t===this._selected||t<0||t>=this._toggles.length)return;this._selected=t,this._applySelection();let n={eventName:r,object:this,selected:t,value:this._toggles[t]?.label??``};this.notify(n)}get selectedValue(){return this._toggles[this._selected]?.label??``}};export{AdwToggleGroup,r as NOTIFY_SELECTED};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t}from"@nativescript/core";const n=`notify::visible-child`;var AdwViewStack=class extends e{_pages=[];_visibleIndex=0;constructor(){super(),this.className=`adw-view-stack`,this.addColumn(new t(1,`star`)),this.addRow(new t(1,`star`))}add(t,n,r,i){let a={name:n,title:r??n,icon:i,content:t};return t.visibility=this._pages.length===0?`visible`:`collapse`,e.setColumn(t,0),e.setRow(t,0),this.addChild(t),this._pages.push(a),a}addTitled(e,t,n){return this.add(e,t,n)}get pages(){return this._pages}get visibleChildIndex(){return this._visibleIndex}set visibleChildIndex(e){!Number.isFinite(e)||e<0||e>=this._pages.length||e!==this._visibleIndex&&(this._visibleIndex=e,this._apply(!0))}get visibleChildName(){return this._pages[this._visibleIndex]?.name??``}set visibleChildName(e){let t=this._pages.findIndex(t=>t.name===e);t>=0&&(this.visibleChildIndex=t)}get visibleChild(){return this._pages[this._visibleIndex]?.content??null}_apply(e){if(this._pages.forEach((e,t)=>{e.content.visibility=t===this._visibleIndex?`visible`:`collapse`}),e){let e=this._pages[this._visibleIndex],t={eventName:n,object:this,index:this._visibleIndex,name:e?.name??``,title:e?.title??``};this.notify(t)}}};export{AdwViewStack,n as NOTIFY_VISIBLE_CHILD};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{attachRowPressFeedback as e}from"./row-press.js";import{AdwIcon as t}from"./adw-icon.js";import{NOTIFY_VISIBLE_CHILD as n}from"./adw-view-stack.js";import{GridLayout as r,ItemSpec as i,Label as a,StackLayout as o}from"@nativescript/core";var AdwViewSwitcherBar=class extends r{_bar;_buttons=[];_stack=null;_stackListener=null;_revealed=!0;constructor(){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`auto`));let e=new r;e.className=`adw-viewswitcherbar-box`,e.addRow(new i(1,`auto`)),r.setRow(e,0),this.addChild(e),this._bar=e,this.addEventListener(`loaded`,()=>this._syncActive())}setStack(e){if(this._stack&&this._stackListener&&this._stack.removeEventListener(n,this._stackListener),this._stack=e,this._stackListener=null,this._rebuild(),e){let listener=()=>this._syncActive();e.addEventListener(n,listener),this._stackListener=listener}}get stack(){return this._stack}set stack(e){this.setStack(e)}get revealed(){return this._revealed}set revealed(e){this._revealed=!!e,this.visibility=this._revealed?`visible`:`collapse`}refresh(){this._rebuild()}_rebuild(){for(let e of this._buttons)this._bar.removeChild(e);this._buttons.length=0,this._bar.removeColumns(),(this._stack?.pages??[]).forEach((n,s)=>{this._bar.addColumn(new i(1,`star`));let c=new o;if(c.orientation=`vertical`,c.className=`adw-viewswitcherbar-button`,c.horizontalAlignment=`stretch`,n.icon){let e=new t;e.className=`${e.className} adw-viewswitcherbar-button-icon`.trim(),e.horizontalAlignment=`center`,e.icon=n.icon,c.addChild(e)}let l=new a;l.text=n.title,l.className=`adw-viewswitcherbar-button-label`,l.horizontalAlignment=`center`,l.textAlignment=`center`,c.addChild(l),e(c),c.addEventListener(`tap`,()=>{this._stack&&(this._stack.visibleChildIndex=s)}),r.setColumn(c,s),this._bar.addChild(c),this._buttons.push(c)}),this._syncActive()}_syncActive(){let e=this._stack?.visibleChildIndex??-1;this._buttons.forEach((t,n)=>{t.className=n===e?`adw-viewswitcherbar-button active`:`adw-viewswitcherbar-button`})}};export{AdwViewSwitcherBar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";const e=/^(min|max)-(width|height)\s*:\s*(\d+(?:\.\d+)?)\s*(px|sp|pt)?$/i;function isLeaf(e){return e.op===void 0}function splitOn(e,t){let n=0;for(let r=e.length-1;r>=0;r--){let i=e[r];if(i===`)`)n++;else if(i===`(`)n--;else if(n===0){let n=r-t.length+1;if(n>0&&r+1<e.length&&/\s/.test(e[n-1])&&/\s/.test(e[r+1])&&e.slice(n,r+1).toLowerCase()===t)return{left:e.slice(0,n),right:e.slice(r+1)}}}return null}function splitTopLevel(e){for(let t of[`or`,`and`]){let n=splitOn(e,t);if(n)return{op:t,...n}}return null}function parseBreakpointCondition(t){let n=t.trim();if(!n)return null;let r=splitTopLevel(n);if(r){let e=parseBreakpointCondition(r.left),t=parseBreakpointCondition(r.right);return!e||!t?null:{op:r.op,left:e,right:t}}if(n.startsWith(`(`)&&n.endsWith(`)`))return parseBreakpointCondition(n.slice(1,-1));let i=e.exec(n);return i?{bound:i[1].toLowerCase(),dimension:i[2].toLowerCase(),value:Number.parseFloat(i[3])}:null}function evaluateBreakpointCondition(e,t){if(isLeaf(e)){let n=e.dimension===`width`?t.width:t.height;return e.bound===`max`?n<=e.value:n>=e.value}let n=evaluateBreakpointCondition(e.left,t);return e.op===`and`?n&&evaluateBreakpointCondition(e.right,t):n||evaluateBreakpointCondition(e.right,t)}var AdwBreakpoint=class{condition;_handlers;_applied=!1;constructor(e,t){this.condition=typeof e==`string`?parseBreakpointCondition(e):e??null,this._handlers=t}get applied(){return this._applied}evaluate(e){let t=this.condition?evaluateBreakpointCondition(this.condition,e):!1;return t===this._applied?this._applied:(this._applied=t,t?this._handlers.onApply():this._handlers.onUnapply?.(),this._applied)}};function measureView(e){let t=e.getActualSize?.();return t&&t.width>0&&t.height>0?{width:t.width,height:t.height}:null}function addBreakpoints(e,t){let recompute=()=>{let n=measureView(e);if(n)for(let e of t)e.evaluate(n)};return e.addEventListener(`layoutChanged`,recompute),e.addEventListener(`loaded`,recompute),recompute(),()=>{e.removeEventListener(`layoutChanged`,recompute),e.removeEventListener(`loaded`,recompute)}}export{AdwBreakpoint,addBreakpoints,evaluateBreakpointCondition,parseBreakpointCondition};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_ICON_COLOR as e,DEFAULT_ICON_COLOR_DARK as t}from"./icon-path.js";let n=`light`;const r=new Set;function adwaitaColorScheme(){return n}function setAdwaitaColorScheme(e){let t=e===`dark`?`dark`:`light`;if(t!==n){n=t;for(let e of[...r])try{e()}catch{}}}function toggleAdwaitaColorScheme(){return setAdwaitaColorScheme(n===`dark`?`light`:`dark`),n}function themeIconColor(){return n===`dark`?t:e}function isThemeIconColor(e){return e===`#33333A`||e===`#FFFFFF`}function onAdwaitaColorSchemeChanged(e){return r.add(e),()=>{r.delete(e)}}export{adwaitaColorScheme,isThemeIconColor,onAdwaitaColorSchemeChanged,setAdwaitaColorScheme,themeIconColor,toggleAdwaitaColorScheme};
|
package/lib/esm/widgets/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwPreferencesPage as e}from"./adw-preferences-page.js";import{AdwPreferencesGroup as t}from"./adw-preferences-group.js";import{AdwActionRow as n}from"./adw-action-row.js";import{AdwSwitchRow as r,NOTIFY_ACTIVE as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwPreferencesPage as e}from"./adw-preferences-page.js";import{AdwPreferencesGroup as t}from"./adw-preferences-group.js";import{AdwActionRow as n}from"./adw-action-row.js";import{AdwSwitchRow as r,NOTIFY_ACTIVE as i}from"./adw-switch-row.js";import{AdwEntryRow as a,NOTIFY_TEXT as o}from"./adw-entry-row.js";import{ADWAITA_ICON_GRID as s,DEFAULT_ICON_COLOR as c,DEFAULT_ICON_COLOR_DARK as ee,extractIconPaths as te,extractPathData as ne}from"./icon-path.js";import{adwaitaColorScheme as re,isThemeIconColor as ie,onAdwaitaColorSchemeChanged as ae,setAdwaitaColorScheme as oe,themeIconColor as se,toggleAdwaitaColorScheme as ce}from"./color-scheme.js";import{renderSymbolicIcon as l}from"./icons.js";import{attachRowPressFeedback as u}from"./row-press.js";import{AdwImageButton as d,DEFAULT_ICON_BUTTON_ICON_SIZE as f}from"./adw-image-button.js";import{AdwPasswordEntryRow as p}from"./adw-password-entry-row.js";import{AdwIcon as m,DEFAULT_ADW_ICON_SIZE as h}from"./adw-icon.js";import{AdwComboRow as g,NOTIFY_SELECTED as le}from"./adw-combo-row.js";import{AdwSpinRow as _,NOTIFY_VALUE as ue}from"./adw-spin-row.js";import{AdwSliderRow as v,NOTIFY_SLIDER_VALUE as de}from"./adw-slider-row.js";import{AdwExpanderRow as y,NOTIFY_EXPANDED as fe}from"./adw-expander-row.js";import{AdwButton as b}from"./adw-button.js";import{AdwMenuButton as x,MENU_ITEM_ACTIVATED as pe}from"./adw-menu-button.js";import{AdwBanner as S,BUTTON_CLICKED as me}from"./adw-banner.js";import{AdwAvatar as C,DEFAULT_AVATAR_SIZE as he,avatarInitials as ge}from"./adw-avatar.js";import{AdwWindowTitle as w}from"./adw-window-title.js";import{AdwClamp as T,DEFAULT_CLAMP_MAX_SIZE as _e}from"./adw-clamp.js";import{AdwHeaderBar as E}from"./adw-header-bar.js";import{AdwToolbarView as D}from"./adw-toolbar-view.js";import{AdwWrapBox as O}from"./adw-wrap-box.js";import{AdwSpinner as k,DEFAULT_SPINNER_SIZE as A}from"./adw-spinner.js";import{AdwStatusPage as j}from"./adw-status-page.js";import{ACTIVATED as M,AdwButtonRow as N}from"./adw-button-row.js";import{AdwButtonContent as P}from"./adw-button-content.js";import{AdwSplitButton as F,CLICKED as I,MENU_TAPPED as L}from"./adw-split-button.js";import{AdwToggleGroup as R,NOTIFY_SELECTED as ve}from"./adw-toggle-group.js";import{AdwViewStack as z,NOTIFY_VISIBLE_CHILD as ye}from"./adw-view-stack.js";import{AdwViewSwitcherBase as be,NOTIFY_SELECTED as xe}from"./view-switcher-base.js";import{AdwViewSwitcher as B}from"./adw-view-switcher.js";import{AdwViewSwitcherBar as V}from"./adw-view-switcher-bar.js";import{AdwInlineViewSwitcher as H}from"./adw-inline-view-switcher.js";import{AdwTabView as U}from"./adw-tab-view.js";import{AdwCarousel as W,DEFAULT_CAROUSEL_PAGE_WIDTH as Se,NOTIFY_POSITION as Ce}from"./adw-carousel.js";import{AdwNavigationView as G,NOTIFY_VISIBLE_PAGE as we}from"./adw-navigation-view.js";import{AdwSplitViewBase as Te,DEFAULT_SIDEBAR_WIDTH as Ee,NOTIFY_SHOW_SIDEBAR as De}from"./split-view-base.js";import{AdwNavigationSplitView as K}from"./adw-navigation-split-view.js";import{AdwOverlaySplitView as q}from"./adw-overlay-split-view.js";import{AdwSidebar as J,NOTIFY_SELECTED as Oe}from"./adw-sidebar.js";import{AdwBottomSheet as Y,NOTIFY_OPEN as ke}from"./adw-bottom-sheet.js";import{AdwToast as Ae,AdwToastOverlay as X,DEFAULT_TOAST_TIMEOUT as je,TOAST_BUTTON_CLICKED as Me}from"./adw-toast-overlay.js";import{AdwAlertDialog as Ne,NOTIFY_RESPONSE as Pe}from"./adw-alert-dialog.js";import{AdwAboutDialog as Z,CLOSED as Fe}from"./adw-about-dialog.js";import{AdwPreferencesDialog as Q,CLOSED as Ie}from"./adw-preferences-dialog.js";import{AdwBreakpoint as Le,addBreakpoints as Re,evaluateBreakpointCondition as ze,parseBreakpointCondition as Be}from"./breakpoint.js";const Ve={AdwPreferencesPage:e,AdwPreferencesGroup:t,AdwActionRow:n,AdwSwitchRow:r,AdwEntryRow:a,AdwPasswordEntryRow:p,AdwComboRow:g,AdwSpinRow:_,AdwSliderRow:v,AdwExpanderRow:y,AdwButton:b,AdwImageButton:d,AdwMenuButton:x,AdwIcon:m,AdwBanner:S,AdwAvatar:C,AdwWindowTitle:w,AdwClamp:T,AdwHeaderBar:E,AdwToolbarView:D,AdwWrapBox:O,AdwSpinner:k,AdwStatusPage:j,AdwButtonRow:N,AdwButtonContent:P,AdwSplitButton:F,AdwToggleGroup:R,AdwViewStack:z,AdwViewSwitcher:B,AdwViewSwitcherBar:V,AdwInlineViewSwitcher:H,AdwTabView:U,AdwCarousel:W,AdwNavigationView:G,AdwNavigationSplitView:K,AdwOverlaySplitView:q,AdwSidebar:J,AdwBottomSheet:Y,AdwToastOverlay:X,AdwAboutDialog:Z,AdwPreferencesDialog:Q};let $=!1;function registerAdwaitaElements(){if(!$&&typeof registerElement==`function`){for(let[e,t]of Object.entries(Ve))registerElement(e,()=>t);$=!0}}export{Fe as ABOUT_CLOSED,M as ACTIVATED,s as ADWAITA_ICON_GRID,Z as AdwAboutDialog,n as AdwActionRow,Ne as AdwAlertDialog,C as AdwAvatar,S as AdwBanner,Y as AdwBottomSheet,Le as AdwBreakpoint,b as AdwButton,P as AdwButtonContent,N as AdwButtonRow,W as AdwCarousel,T as AdwClamp,g as AdwComboRow,a as AdwEntryRow,y as AdwExpanderRow,E as AdwHeaderBar,m as AdwIcon,d as AdwImageButton,H as AdwInlineViewSwitcher,x as AdwMenuButton,K as AdwNavigationSplitView,G as AdwNavigationView,q as AdwOverlaySplitView,p as AdwPasswordEntryRow,Q as AdwPreferencesDialog,t as AdwPreferencesGroup,e as AdwPreferencesPage,J as AdwSidebar,v as AdwSliderRow,_ as AdwSpinRow,k as AdwSpinner,F as AdwSplitButton,Te as AdwSplitViewBase,j as AdwStatusPage,r as AdwSwitchRow,U as AdwTabView,Ae as AdwToast,X as AdwToastOverlay,R as AdwToggleGroup,D as AdwToolbarView,z as AdwViewStack,B as AdwViewSwitcher,V as AdwViewSwitcherBar,be as AdwViewSwitcherBase,w as AdwWindowTitle,O as AdwWrapBox,me as BUTTON_CLICKED,I as CLICKED,h as DEFAULT_ADW_ICON_SIZE,he as DEFAULT_AVATAR_SIZE,Se as DEFAULT_CAROUSEL_PAGE_WIDTH,_e as DEFAULT_CLAMP_MAX_SIZE,f as DEFAULT_ICON_BUTTON_ICON_SIZE,c as DEFAULT_ICON_COLOR,ee as DEFAULT_ICON_COLOR_DARK,Ee as DEFAULT_SIDEBAR_WIDTH,A as DEFAULT_SPINNER_SIZE,je as DEFAULT_TOAST_TIMEOUT,pe as MENU_ITEM_ACTIVATED,L as MENU_TAPPED,i as NOTIFY_ACTIVE,fe as NOTIFY_EXPANDED,ke as NOTIFY_OPEN,Ce as NOTIFY_POSITION,Pe as NOTIFY_RESPONSE,le as NOTIFY_SELECTED,De as NOTIFY_SHOW_SIDEBAR,Oe as NOTIFY_SIDEBAR_SELECTED,de as NOTIFY_SLIDER_VALUE,o as NOTIFY_TEXT,ve as NOTIFY_TOGGLE_SELECTED,ue as NOTIFY_VALUE,xe as NOTIFY_VIEW_SELECTED,ye as NOTIFY_VISIBLE_CHILD,we as NOTIFY_VISIBLE_PAGE,Ie as PREFERENCES_CLOSED,Me as TOAST_BUTTON_CLICKED,Re as addBreakpoints,re as adwaitaColorScheme,u as attachRowPressFeedback,ge as avatarInitials,ze as evaluateBreakpointCondition,te as extractIconPaths,ne as extractPathData,ie as isThemeIconColor,ae as onAdwaitaColorSchemeChanged,Be as parseBreakpointCondition,registerAdwaitaElements,l as renderSymbolicIcon,oe as setAdwaitaColorScheme,se as themeIconColor,ce as toggleAdwaitaColorScheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t}from"@nativescript/core";const n=`notify::show-sidebar`,r=240;var AdwSplitViewBase=class extends e{_sidebar=null;_content=null;_collapsed=!1;_showSidebar=!0;_sidebarWidth=240;_sidebarPosition=`start`;constructor(e){super(),this.className=e,this.addRow(new t(1,`star`)),this.addColumn(new t(1,`auto`)),this.addColumn(new t(1,`star`))}_transitionSidebar(){this._applyLayout()}_pending=[];_shouldAnimate(){return typeof(this._sidebar??this._content??this).animate==`function`&&this.isLoaded===!0}_track(e){return this._pending.push(e),e}_cancelPending(){for(let e of this._pending)try{e.cancel()}catch{}this._pending=[]}_isChild(e){for(let t=0;t<this.getChildrenCount();t++)if(this.getChildAt(t)===e)return!0;return!1}setSidebar(e){this._sidebar&&this.removeChild(this._sidebar),this._sidebar=e,e&&(e.className=`${e.className??``} adw-split-view-sidebar`.trim(),e.width=this._sidebarWidth,this.addChild(e)),this._applyLayout()}setContent(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-split-view-content`.trim(),this.addChild(e)),this._applyLayout()}showSidebarPane(){this.showSidebar=!0}hideSidebarPane(){this.showSidebar=!1}get collapsed(){return this._collapsed}set collapsed(e){this._collapsed=!!e,this._applyLayout()}get showSidebar(){return this._showSidebar}set showSidebar(e){let t=!!e;if(t===this._showSidebar)return;this._showSidebar=t,this._transitionSidebar();let r={eventName:n,object:this,showSidebar:t,collapsed:this._collapsed};this.notify(r)}get sidebarWidth(){return this._sidebarWidth}set sidebarWidth(e){this._sidebarWidth=Number.isFinite(e)&&e>0?e:240,this._sidebar&&(this._sidebar.width=this._sidebarWidth)}get sidebarPosition(){return this._sidebarPosition}set sidebarPosition(e){this._sidebarPosition=e===`end`?`end`:`start`,this._applyLayout()}get sidebar(){return this._sidebar}get content(){return this._content}};export{AdwSplitViewBase,r as DEFAULT_SIDEBAR_WIDTH,n as NOTIFY_SHOW_SIDEBAR};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{GridLayout as e,ItemSpec as t}from"@nativescript/core";const n=`notify::show-sidebar`,r=240;var AdwSplitViewBase=class extends e{_sidebar=null;_content=null;_collapsed=!1;_showSidebar=!0;_sidebarWidth=240;_sidebarPosition=`start`;constructor(e){super(),this.className=e,this.addRow(new t(1,`star`)),this._syncColumns()}_syncColumns(){this.removeColumns(),this._sidebarPosition===`end`?(this.addColumn(new t(1,`star`)),this.addColumn(new t(1,`auto`))):(this.addColumn(new t(1,`auto`)),this.addColumn(new t(1,`star`)))}_transitionSidebar(){this._applyLayout()}_pending=[];_shouldAnimate(){return typeof(this._sidebar??this._content??this).animate==`function`&&this.isLoaded===!0}_track(e){return this._pending.push(e),e}_cancelPending(){for(let e of this._pending)try{e.cancel()}catch{}this._pending=[]}_isChild(e){for(let t=0;t<this.getChildrenCount();t++)if(this.getChildAt(t)===e)return!0;return!1}setSidebar(e){this._sidebar&&this.removeChild(this._sidebar),this._sidebar=e,e&&(e.className=`${e.className??``} adw-split-view-sidebar`.trim(),e.width=this._sidebarWidth,this.addChild(e)),this._applyLayout()}setContent(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-split-view-content`.trim(),this.addChild(e)),this._applyLayout()}showSidebarPane(){this.showSidebar=!0}hideSidebarPane(){this.showSidebar=!1}get collapsed(){return this._collapsed}set collapsed(e){this._collapsed=!!e,this._applyLayout()}get showSidebar(){return this._showSidebar}set showSidebar(e){let t=!!e;if(t===this._showSidebar)return;this._showSidebar=t,this._transitionSidebar();let r={eventName:n,object:this,showSidebar:t,collapsed:this._collapsed};this.notify(r)}get sidebarWidth(){return this._sidebarWidth}set sidebarWidth(e){this._sidebarWidth=Number.isFinite(e)&&e>0?e:240,this._sidebar&&(this._sidebar.width=this._sidebarWidth)}get sidebarPosition(){return this._sidebarPosition}set sidebarPosition(e){this._sidebarPosition=e===`end`?`end`:`start`,this._syncColumns(),this._applyLayout()}get sidebar(){return this._sidebar}get content(){return this._content}};export{AdwSplitViewBase,r as DEFAULT_SIDEBAR_WIDTH,n as NOTIFY_SHOW_SIDEBAR};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{attachRowPressFeedback as e}from"./row-press.js";import{AdwIcon as t}from"./adw-icon.js";import{GridLayout as n,ItemSpec as r,Label as i,StackLayout as a}from"@nativescript/core";const o=`notify::selected`;var AdwViewSwitcherBase=class extends n{_bar;_contentArea;_pages=[];_buttons=[];_selected=0;constructor(e){super(),this.className=e,this.addColumn(new r(1,`star`)),this.addRow(new r(1,`auto`)),this.addRow(new r(1,`star`));let t=new a;t.orientation=`horizontal`,t.horizontalAlignment=`center`,n.setRow(t,0),this.addChild(t),this._bar=t;let i=new n;i.addColumn(new r(1,`star`)),i.addRow(new r(1,`star`)),n.setRow(i,1),this.addChild(i),this._contentArea=i}_initClasses(){this._bar.className=this.barClass}setViews(r){for(let e of this._buttons)this._bar.removeChild(e);this._buttons.length=0;for(let e of this._pages)this._contentArea.removeChild(e.content);this._pages.length=0;for(let o of r){this._pages.push(o);let r=this._buttons.length,s=new a;if(s.orientation=`horizontal`,s.className=this.buttonClass,s.horizontalAlignment=`center`,o.icon){let e=new t;e.className=`${e.className} ${this.buttonClass}-icon`.trim(),e.verticalAlignment=`middle`,e.icon=o.icon,s.addChild(e)}let c=new i;c.text=o.title,c.className=`${this.buttonClass}-label`,c.verticalAlignment=`middle`,s.addChild(c),this._buildButtonExtras(s,o,r),e(s),s.addEventListener(`tap`,()=>{this.selected=r}),this._bar.addChild(s),this._buttons.push(s),n.setColumn(o.content,0),n.setRow(o.content,0),this._contentArea.addChild(o.content)}this._selected>=this._pages.length&&(this._selected=0),this._applySelection()}_applySelection(){this._pages.forEach((e,t)=>{e.content.visibility=t===this._selected?`visible`:`collapse`}),this._buttons.forEach((e,t)=>{let n=t===this._selected;e.className=n?`${this.buttonClass} active`:this.buttonClass,this._applyButtonState(e,t,n)})}_buildButtonExtras(e,t,n){}_applyButtonState(e,t,n){}get views(){return this._pages}set views(e){this.setViews(Array.isArray(e)?e:[])}get selected(){return this._selected}set selected(e){let t=Number.isFinite(e)?e:0;if(t===this._selected||t<0||t>=this._pages.length)return;this._selected=t,this._applySelection();let n={eventName:o,object:this,selected:t,title:this._pages[t]?.title??``};this.notify(n)}};export{AdwViewSwitcherBase,o as NOTIFY_SELECTED};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { assertNativeScript, isNativeScript, isAndroid, isIOS } from '@gjsify/native-platform';
|
|
2
|
-
export { AdwPreferencesPage, AdwPreferencesGroup, AdwActionRow, AdwSwitchRow, NOTIFY_ACTIVE, AdwEntryRow, NOTIFY_TEXT, AdwPasswordEntryRow, AdwComboRow, NOTIFY_SELECTED, AdwSpinRow, NOTIFY_VALUE, AdwSliderRow, NOTIFY_SLIDER_VALUE, AdwExpanderRow, NOTIFY_EXPANDED, AdwButton, AdwImageButton, DEFAULT_ICON_BUTTON_ICON_SIZE, AdwIcon, DEFAULT_ADW_ICON_SIZE, AdwBanner, BUTTON_CLICKED, AdwAvatar, DEFAULT_AVATAR_SIZE, avatarInitials, AdwWindowTitle, AdwClamp, DEFAULT_CLAMP_MAX_SIZE, AdwHeaderBar, AdwToolbarView, AdwWrapBox, AdwSpinner, DEFAULT_SPINNER_SIZE, AdwStatusPage, AdwButtonRow, ACTIVATED, AdwButtonContent, AdwSplitButton, CLICKED, MENU_TAPPED, AdwToggleGroup, NOTIFY_TOGGLE_SELECTED, AdwViewSwitcherBase, NOTIFY_VIEW_SELECTED, AdwViewSwitcher, AdwInlineViewSwitcher, AdwTabView, AdwCarousel, DEFAULT_CAROUSEL_PAGE_WIDTH, NOTIFY_POSITION, AdwNavigationView, NOTIFY_VISIBLE_PAGE, AdwSplitViewBase, DEFAULT_SIDEBAR_WIDTH, NOTIFY_SHOW_SIDEBAR, AdwNavigationSplitView, AdwOverlaySplitView, AdwSidebar, NOTIFY_SIDEBAR_SELECTED, AdwBottomSheet, NOTIFY_OPEN, AdwToast, AdwToastOverlay, DEFAULT_TOAST_TIMEOUT, TOAST_BUTTON_CLICKED, AdwAlertDialog, NOTIFY_RESPONSE, AdwAboutDialog, ABOUT_CLOSED, AdwPreferencesDialog, PREFERENCES_CLOSED, attachRowPressFeedback, renderSymbolicIcon, extractIconPaths, extractPathData, ADWAITA_ICON_GRID, DEFAULT_ICON_COLOR, DEFAULT_ICON_COLOR_DARK, registerAdwaitaElements, } from './widgets/index.js';
|
|
3
|
-
export type { NotifyActiveEventData, NotifyTextEventData, AdwComboOption, NotifySelectedEventData, NotifyValueEventData, NotifySliderValueEventData, NotifyExpandedEventData, AdwButtonVariant, MenuTappedEventData, NotifyToggleSelectedEventData, AdwViewPage, NotifyViewSelectedEventData, NotifyPositionEventData, NotifyVisiblePageEventData, NotifyShowSidebarEventData, NotifySidebarSelectedEventData, NotifyOpenEventData, AdwToastOptions, NotifyResponseEventData, SymbolicIconOptions, IconPath, } from './widgets/index.js';
|
|
2
|
+
export { AdwPreferencesPage, AdwPreferencesGroup, AdwActionRow, AdwSwitchRow, NOTIFY_ACTIVE, AdwEntryRow, NOTIFY_TEXT, AdwPasswordEntryRow, AdwComboRow, NOTIFY_SELECTED, AdwSpinRow, NOTIFY_VALUE, AdwSliderRow, NOTIFY_SLIDER_VALUE, AdwExpanderRow, NOTIFY_EXPANDED, AdwButton, AdwImageButton, DEFAULT_ICON_BUTTON_ICON_SIZE, AdwMenuButton, MENU_ITEM_ACTIVATED, AdwIcon, DEFAULT_ADW_ICON_SIZE, AdwBanner, BUTTON_CLICKED, AdwAvatar, DEFAULT_AVATAR_SIZE, avatarInitials, AdwWindowTitle, AdwClamp, DEFAULT_CLAMP_MAX_SIZE, AdwHeaderBar, AdwToolbarView, AdwWrapBox, AdwSpinner, DEFAULT_SPINNER_SIZE, AdwStatusPage, AdwButtonRow, ACTIVATED, AdwButtonContent, AdwSplitButton, CLICKED, MENU_TAPPED, AdwToggleGroup, NOTIFY_TOGGLE_SELECTED, AdwViewStack, NOTIFY_VISIBLE_CHILD, AdwViewSwitcherBase, NOTIFY_VIEW_SELECTED, AdwViewSwitcher, AdwViewSwitcherBar, AdwInlineViewSwitcher, AdwTabView, AdwCarousel, DEFAULT_CAROUSEL_PAGE_WIDTH, NOTIFY_POSITION, AdwNavigationView, NOTIFY_VISIBLE_PAGE, AdwSplitViewBase, DEFAULT_SIDEBAR_WIDTH, NOTIFY_SHOW_SIDEBAR, AdwNavigationSplitView, AdwOverlaySplitView, AdwSidebar, NOTIFY_SIDEBAR_SELECTED, AdwBottomSheet, NOTIFY_OPEN, AdwToast, AdwToastOverlay, DEFAULT_TOAST_TIMEOUT, TOAST_BUTTON_CLICKED, AdwAlertDialog, NOTIFY_RESPONSE, AdwAboutDialog, ABOUT_CLOSED, AdwPreferencesDialog, PREFERENCES_CLOSED, attachRowPressFeedback, renderSymbolicIcon, extractIconPaths, extractPathData, ADWAITA_ICON_GRID, DEFAULT_ICON_COLOR, DEFAULT_ICON_COLOR_DARK, adwaitaColorScheme, isThemeIconColor, onAdwaitaColorSchemeChanged, setAdwaitaColorScheme, themeIconColor, toggleAdwaitaColorScheme, AdwBreakpoint, addBreakpoints, evaluateBreakpointCondition, parseBreakpointCondition, registerAdwaitaElements, } from './widgets/index.js';
|
|
3
|
+
export type { NotifyActiveEventData, NotifyTextEventData, AdwComboOption, NotifySelectedEventData, NotifyValueEventData, NotifySliderValueEventData, NotifyExpandedEventData, AdwButtonVariant, AdwMenuItem, MenuItemActivatedEventData, MenuTappedEventData, NotifyToggleSelectedEventData, AdwViewStackPage, NotifyVisibleChildEventData, AdwViewPage, NotifyViewSelectedEventData, NotifyPositionEventData, NotifyVisiblePageEventData, NotifyShowSidebarEventData, NotifySidebarSelectedEventData, NotifyOpenEventData, AdwToastOptions, NotifyResponseEventData, SymbolicIconOptions, IconPath, AdwColorScheme, AdwBreakpointHandlers, BreakpointBound, BreakpointConditionGroup, BreakpointConditionLeaf, BreakpointConditionNode, BreakpointDimension, BreakpointSize, } from './widgets/index.js';
|
|
4
4
|
export { ADWAITA_SANS_FONT_FAMILY, ADWAITA_SANS_TTF_FILES, adwaitaFontInstallInstructions, hasAdwaitaSans, } from './fonts.js';
|
|
5
5
|
/**
|
|
6
6
|
* One-call convenience setup for the Adwaita NativeScript layer.
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { GridLayout, StackLayout, Label, View } from '@nativescript/core';
|
|
2
2
|
export declare class AdwActionRow extends GridLayout {
|
|
3
|
-
/** The text/value column (column
|
|
3
|
+
/** The text/value column (column 1). */
|
|
4
4
|
protected readonly _textStack: StackLayout;
|
|
5
5
|
/** The title label. */
|
|
6
6
|
protected readonly _titleLabel: Label;
|
|
7
7
|
/** The subtitle label (created lazily — only added to the tree when set). */
|
|
8
8
|
protected readonly _subtitleLabel: Label;
|
|
9
9
|
private _hasSubtitle;
|
|
10
|
-
/** The currently-installed
|
|
10
|
+
/** The currently-installed prefix view (column 0), if any. */
|
|
11
|
+
private _prefix;
|
|
12
|
+
/** The currently-installed suffix view (column 2), if any. */
|
|
11
13
|
private _suffix;
|
|
12
14
|
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* Install a prefix widget in column 0 (e.g. an `AdwIcon` symbolic icon).
|
|
17
|
+
* Replaces any previously-installed prefix. Pass `null` to clear it.
|
|
18
|
+
*/
|
|
19
|
+
setPrefix(view: View | null): void;
|
|
20
|
+
/** The currently-installed prefix view, or `null`. */
|
|
21
|
+
get prefix(): View | null;
|
|
13
22
|
/** The row title (column 0, top line). */
|
|
14
23
|
get title(): string;
|
|
15
24
|
set title(value: string);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { GridLayout, Label } from '@nativescript/core';
|
|
2
2
|
/** Default avatar diameter in DIPs (Adwaita's common avatar size). */
|
|
3
3
|
export declare const DEFAULT_AVATAR_SIZE = 48;
|
|
4
|
+
/** The flat fill + initials colour `Adw.Avatar` would pick for `text`. */
|
|
5
|
+
export declare function avatarColor(text: string): {
|
|
6
|
+
fill: string;
|
|
7
|
+
fg: string;
|
|
8
|
+
};
|
|
4
9
|
/** Derive up to two-letter initials from a name (`"Ada Lovelace"` → `"AL"`). */
|
|
5
10
|
export declare function avatarInitials(text: string): string;
|
|
6
11
|
export declare class AdwAvatar extends GridLayout {
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { Label, StackLayout } from '@nativescript/core';
|
|
2
|
+
import { AdwIcon } from './adw-icon.js';
|
|
2
3
|
export declare class AdwButtonContent extends StackLayout {
|
|
3
|
-
/** The leading
|
|
4
|
-
protected readonly
|
|
4
|
+
/** The leading symbolic icon (lazily in the tree — only when an icon is set). */
|
|
5
|
+
protected readonly _icon: AdwIcon;
|
|
5
6
|
/** The text label. */
|
|
6
7
|
protected readonly _label: Label;
|
|
7
8
|
private _hasIcon;
|
|
9
|
+
private _iconSvg;
|
|
8
10
|
constructor();
|
|
9
11
|
/**
|
|
10
|
-
* A leading
|
|
11
|
-
* Setting a non-empty value inserts
|
|
12
|
+
* A leading Adwaita symbolic SVG string (e.g. `folderDownloadSymbolic`).
|
|
13
|
+
* Setting a non-empty value inserts the icon before the label; empty removes it.
|
|
12
14
|
*/
|
|
13
|
-
get
|
|
14
|
-
set
|
|
15
|
+
get icon(): string;
|
|
16
|
+
set icon(svg: string);
|
|
17
|
+
/** The icon fill colour (hex). Set to the button's foreground (e.g. white on suggested-action). */
|
|
18
|
+
get iconColor(): string;
|
|
19
|
+
set iconColor(value: string);
|
|
15
20
|
/** The button content text. */
|
|
16
21
|
get label(): string;
|
|
17
22
|
set label(value: string);
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StackLayout } from '@nativescript/core';
|
|
2
2
|
import { AdwActionRow } from './adw-action-row.js';
|
|
3
|
+
import { AdwIcon } from './adw-icon.js';
|
|
3
4
|
/** Event name emitted when the row is tapped. Mirrors `Adw.ButtonRow::activated`. */
|
|
4
5
|
export declare const ACTIVATED = "activated";
|
|
5
6
|
export declare class AdwButtonRow extends AdwActionRow {
|
|
6
|
-
/** The horizontal content box (leading
|
|
7
|
+
/** The horizontal content box (leading icon + centered title). */
|
|
7
8
|
protected readonly _contentBox: StackLayout;
|
|
8
|
-
/** The leading
|
|
9
|
-
protected readonly
|
|
9
|
+
/** The leading symbolic icon (lazily added — only when an icon is set). */
|
|
10
|
+
protected readonly _startIcon: AdwIcon;
|
|
10
11
|
private _hasStartIcon;
|
|
12
|
+
private _startIconSvg;
|
|
11
13
|
constructor();
|
|
12
14
|
/**
|
|
13
|
-
* A leading
|
|
14
|
-
* non-empty value inserts it; empty removes it.
|
|
15
|
+
* A leading Adwaita symbolic SVG string before the centered title (e.g.
|
|
16
|
+
* `listAddSymbolic`). Setting a non-empty value inserts it; empty removes it.
|
|
15
17
|
*/
|
|
16
18
|
get startIcon(): string;
|
|
17
19
|
set startIcon(value: string);
|
|
20
|
+
/**
|
|
21
|
+
* The start icon's fill colour (hex). Defaults to the Adwaita accent; callers
|
|
22
|
+
* set the destructive red when the row carries `destructive-action` so the
|
|
23
|
+
* symbolic icon matches the title colour (the icon bitmap is pre-coloured, so
|
|
24
|
+
* CSS cannot recolour it).
|
|
25
|
+
*/
|
|
26
|
+
get startIconColor(): string;
|
|
27
|
+
set startIconColor(value: string);
|
|
18
28
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ItemSpec, StackLayout, View, type EventData } from '@nativescript/core';
|
|
2
2
|
import { AdwActionRow } from './adw-action-row.js';
|
|
3
|
+
import { AdwIcon } from './adw-icon.js';
|
|
3
4
|
/** Event name emitted when {@link AdwExpanderRow.expanded} changes. Mirrors GObject `notify::expanded`. */
|
|
4
5
|
export declare const NOTIFY_EXPANDED = "notify::expanded";
|
|
5
6
|
/** Payload of the `notify::expanded` event. */
|
|
@@ -8,8 +9,8 @@ export interface NotifyExpandedEventData extends EventData {
|
|
|
8
9
|
expanded: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare class AdwExpanderRow extends AdwActionRow {
|
|
11
|
-
/** The disclosure
|
|
12
|
-
protected readonly _toggle:
|
|
12
|
+
/** The disclosure chevron (suffix) — a plain symbolic icon, like Adw.ExpanderRow. */
|
|
13
|
+
protected readonly _toggle: AdwIcon;
|
|
13
14
|
/** The container of revealed child rows (second grid row). */
|
|
14
15
|
protected readonly _disclosure: StackLayout;
|
|
15
16
|
private _expanded;
|
|
@@ -4,13 +4,19 @@ export declare const DEFAULT_ADW_ICON_SIZE = 16;
|
|
|
4
4
|
export declare class AdwIcon extends Image {
|
|
5
5
|
private _iconSvg;
|
|
6
6
|
private _iconColor;
|
|
7
|
+
private _explicitColor;
|
|
7
8
|
private _iconSize;
|
|
9
|
+
private _unsubScheme;
|
|
8
10
|
constructor();
|
|
11
|
+
/** Adopt the active scheme's default fill (no-op if the caller pinned a colour). */
|
|
12
|
+
private _syncThemeColor;
|
|
9
13
|
private _render;
|
|
10
14
|
/** The Adwaita symbolic SVG string to render (e.g. `panDownSymbolic`). */
|
|
11
15
|
get icon(): string;
|
|
12
16
|
set icon(svg: string);
|
|
13
|
-
/** The icon fill colour (hex).
|
|
17
|
+
/** The icon fill colour (hex). Setting it PINS the colour (it no longer follows
|
|
18
|
+
* the light/dark scheme) — use it for context colours like white on a suggested
|
|
19
|
+
* button or destructive red, which must survive both schemes. */
|
|
14
20
|
get iconColor(): string;
|
|
15
21
|
set iconColor(value: string);
|
|
16
22
|
/** The icon size in DIPs (default 16). Re-renders + resizes the image box. */
|
|
@@ -6,14 +6,19 @@ export declare class AdwImageButton extends GridLayout {
|
|
|
6
6
|
protected readonly _image: Image;
|
|
7
7
|
private _iconSvg;
|
|
8
8
|
private _iconColor;
|
|
9
|
+
private _explicitColor;
|
|
9
10
|
private _iconSize;
|
|
11
|
+
private _unsubScheme;
|
|
10
12
|
constructor();
|
|
13
|
+
/** Adopt the active scheme's default fill (no-op if the caller pinned a colour). */
|
|
14
|
+
private _syncThemeColor;
|
|
11
15
|
/** Re-render the icon bitmap from the current svg / colour / size. */
|
|
12
16
|
private _render;
|
|
13
17
|
/** The Adwaita symbolic SVG string to render (e.g. `goPreviousSymbolic`). */
|
|
14
18
|
get icon(): string;
|
|
15
19
|
set icon(svg: string);
|
|
16
|
-
/** The icon fill colour (hex).
|
|
20
|
+
/** The icon fill colour (hex). Setting it PINS the colour (it no longer follows
|
|
21
|
+
* the light/dark scheme) — for context colours that must survive both schemes. */
|
|
17
22
|
get iconColor(): string;
|
|
18
23
|
set iconColor(value: string);
|
|
19
24
|
/** The icon size in DIPs (default 16). Re-renders + resizes the image box. */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type EventData } from '@nativescript/core';
|
|
2
|
+
import { AdwImageButton } from './adw-image-button.js';
|
|
3
|
+
/** Event name emitted when a menu item is chosen. */
|
|
4
|
+
export declare const MENU_ITEM_ACTIVATED = "menuItemActivated";
|
|
5
|
+
/** One entry in an {@link AdwMenuButton}'s menu. */
|
|
6
|
+
export interface AdwMenuItem {
|
|
7
|
+
/** Stable identifier reported on activation (defaults to {@link label}). */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** The menu item's display label. */
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
/** Payload of the {@link MENU_ITEM_ACTIVATED} event. */
|
|
13
|
+
export interface MenuItemActivatedEventData extends EventData {
|
|
14
|
+
/** The chosen item's id (or its label when no id was given). */
|
|
15
|
+
id: string;
|
|
16
|
+
/** The chosen item's label. */
|
|
17
|
+
label: string;
|
|
18
|
+
/** The chosen item's index in {@link AdwMenuButton.menuItems}. */
|
|
19
|
+
index: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class AdwMenuButton extends AdwImageButton {
|
|
22
|
+
private _items;
|
|
23
|
+
private _menuTitle;
|
|
24
|
+
constructor();
|
|
25
|
+
/** The menu items (opened as a native `action()` sheet on tap). */
|
|
26
|
+
get menuItems(): AdwMenuItem[];
|
|
27
|
+
set menuItems(value: AdwMenuItem[]);
|
|
28
|
+
/** Optional title shown atop the native menu sheet. */
|
|
29
|
+
get menuTitle(): string;
|
|
30
|
+
set menuTitle(value: string);
|
|
31
|
+
private _openMenu;
|
|
32
|
+
}
|