create-basicjs 0.1.5 → 0.1.6
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/README.md +10 -0
- package/bin/create-basicjs.js +27 -1
- package/package.json +1 -1
- package/payload/projects/tauri/.github/workflows/build.yml +86 -0
- package/payload/projects/tauri/.github/workflows/tests.yml +87 -0
- package/payload/projects/tauri/AGENTS.md +128 -0
- package/payload/projects/tauri/CLAUDE.md +1 -0
- package/payload/projects/tauri/LICENSE +201 -0
- package/payload/projects/tauri/NOTICE +8 -0
- package/payload/projects/tauri/README.md +269 -0
- package/payload/projects/tauri/checks/window-check.js +189 -0
- package/payload/projects/tauri/gitignore +8 -0
- package/payload/projects/tauri/handbook/01-getting-started.md +188 -0
- package/payload/projects/tauri/handbook/02-the-project.md +264 -0
- package/payload/projects/tauri/handbook/03-the-page.md +260 -0
- package/payload/projects/tauri/handbook/04-commands.md +265 -0
- package/payload/projects/tauri/handbook/05-events-and-state.md +275 -0
- package/payload/projects/tauri/handbook/06-plugins.md +282 -0
- package/payload/projects/tauri/handbook/07-the-window-and-the-app.md +431 -0
- package/payload/projects/tauri/handbook/08-security.md +374 -0
- package/payload/projects/tauri/handbook/09-tests-and-checks.md +266 -0
- package/payload/projects/tauri/handbook/10-building-and-releasing.md +238 -0
- package/payload/projects/tauri/handbook/11-troubleshooting.md +259 -0
- package/payload/projects/tauri/handbook/README.md +125 -0
- package/payload/projects/tauri/handbook/turkce/01-getting-started.md +193 -0
- package/payload/projects/tauri/handbook/turkce/02-the-project.md +272 -0
- package/payload/projects/tauri/handbook/turkce/03-the-page.md +272 -0
- package/payload/projects/tauri/handbook/turkce/04-commands.md +271 -0
- package/payload/projects/tauri/handbook/turkce/05-events-and-state.md +284 -0
- package/payload/projects/tauri/handbook/turkce/06-plugins.md +286 -0
- package/payload/projects/tauri/handbook/turkce/07-the-window-and-the-app.md +433 -0
- package/payload/projects/tauri/handbook/turkce/08-security.md +384 -0
- package/payload/projects/tauri/handbook/turkce/09-tests-and-checks.md +275 -0
- package/payload/projects/tauri/handbook/turkce/10-building-and-releasing.md +241 -0
- package/payload/projects/tauri/handbook/turkce/11-troubleshooting.md +264 -0
- package/payload/projects/tauri/handbook/turkce/README.md +128 -0
- package/payload/projects/tauri/images/app.png +0 -0
- package/payload/projects/tauri/src-tauri/Cargo.lock +4389 -0
- package/payload/projects/tauri/src-tauri/Cargo.toml +31 -0
- package/payload/projects/tauri/src-tauri/app-icon.svg +16 -0
- package/payload/projects/tauri/src-tauri/build.rs +15 -0
- package/payload/projects/tauri/src-tauri/capabilities/default.json +7 -0
- package/payload/projects/tauri/src-tauri/gitignore +5 -0
- package/payload/projects/tauri/src-tauri/icons/128x128.png +0 -0
- package/payload/projects/tauri/src-tauri/icons/128x128@2x.png +0 -0
- package/payload/projects/tauri/src-tauri/icons/32x32.png +0 -0
- package/payload/projects/tauri/src-tauri/icons/icon.icns +0 -0
- package/payload/projects/tauri/src-tauri/icons/icon.ico +0 -0
- package/payload/projects/tauri/src-tauri/src/check.rs +144 -0
- package/payload/projects/tauri/src-tauri/src/files.rs +255 -0
- package/payload/projects/tauri/src-tauri/src/main.rs +45 -0
- package/payload/projects/tauri/src-tauri/src/sizes.rs +214 -0
- package/payload/projects/tauri/src-tauri/tauri.conf.json +44 -0
- package/payload/projects/tauri/src-tauri/tests/project.rs +243 -0
- package/payload/projects/tauri/ui/app.js +459 -0
- package/payload/projects/tauri/ui/backend.js +196 -0
- package/payload/projects/tauri/ui/basic/LICENSE +14 -0
- package/payload/projects/tauri/ui/basic/basic.min.css +1 -0
- package/payload/projects/tauri/ui/basic/basic.min.js +78 -0
- package/payload/projects/tauri/ui/basic/font/open-sans/LICENSE.txt +206 -0
- package/payload/projects/tauri/ui/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
- package/payload/projects/tauri/ui/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
- package/payload/projects/tauri/ui/basic/scroll-bar.min.js +3 -0
- package/payload/projects/tauri/ui/comp/_sources.txt +9 -0
- package/payload/projects/tauri/ui/comp/components.min.js +21 -0
- package/payload/projects/tauri/ui/index.html +28 -0
- package/payload/projects/tauri/ui/sizes.js +104 -0
- package/payload/starter/_basic/VERSION +1 -1
- package/payload/starter/_basic/comp/bottom-bar.js +31 -3
- package/payload/starter/_basic/comp/code-editor.js +219 -1
- package/payload/starter/_basic/comp/context-menu.js +6 -1
- package/payload/starter/_basic/comp/markdown-view.js +4 -2
- package/payload/starter/_basic/comp/property-panel.js +1 -1
- package/payload/starter/_basic/comp/slider.js +27 -12
- package/payload/starter/_basic/comp/smart-button.js +5 -1
- package/payload/starter/_basic/comp/smart-table.js +8 -1
- package/payload/starter/_basic/comp/stepper.js +29 -3
- package/payload/starter/_basic/comp/toggle.js +2 -1
- package/payload/starter/_basic/docs/component-index.md +53 -53
- package/payload/starter/_basic/examples/code-editor.htm +48 -1
- package/payload/starter/_basic/examples/gallery-styled.htm +896 -0
- package/payload/starter/_basic/examples/search-input.htm +1 -1
- package/payload/starter/_basic/examples/select-box-2-item-view.htm +304 -0
- package/payload/starter/_basic/examples/{slider-2-classic.htm → slider-2-split.htm} +36 -2
- package/payload/starter/_basic/examples/stepper-2.htm +22 -6
- package/payload/starter/_basic/min/bottom-bar.min.js +1 -1
- package/payload/starter/_basic/min/code-editor.min.js +1 -1
- package/payload/starter/_basic/min/context-menu.min.js +1 -1
- package/payload/starter/_basic/min/markdown-view.min.js +1 -1
- package/payload/starter/_basic/min/slider.min.js +1 -1
- package/payload/starter/_basic/min/smart-button.min.js +1 -1
- package/payload/starter/_basic/min/smart-table.min.js +1 -1
- package/payload/starter/_basic/min/stepper.min.js +1 -1
- package/payload/starter/_basic/min/toggle.min.js +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
/*! Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/) | Apache-2.0 | https://bug7a.github.io/js-components/ */
|
|
3
|
+
"use strict";const SmartButtonDefaults={key:"0",styleName:"ozden",tone:"",width:"auto",height:44,labelText:"Button",allowHtml:0,iconFile:"",iconPosition:"left",enabled:1,ariaLabel:"",waiting:0,waitingType:"clock",animated:1,ripple:0,ask:"",onBeforeClick:null,onClick:function(t){},onWaitingEnd:function(t){},style:{layout:{gap:8,padding:[16,0],align:"center center",iconSideTrim:2},icon:{width:24,height:24,opacity:.8,filter:"none"},label:{fontSize:20,textColor:Black(.7),fontFamily:"opensans"},box:{color:"#E3E3E3",border:1,borderColor:Black(.35),round:4,boxShadow:"inset 0 -2px 0 rgba(0, 0, 0, 0.25)"},hover:{color:"#D9D9D9",borderColor:""},ask:{button:{color:"#DE815B",borderColor:"#DE815B",boxShadow:"none",textColor:"white",iconFilter:"brightness(0) invert(1)"},bubble:{color:"#DE815B",textColor:"white",fontSize:13,bold:1,round:8,padding:[12,7],border:0,borderColor:"",shadow:"0 6px 16px rgba(0, 0, 0, 0.18)",arrow:12,gap:6,edge:8,grow:1},time:5e3},focus:{ringColor:"rgba(95, 158, 160, 0.6)"},disabled:{color:"#EBEBEA",borderColor:"rgba(0, 0, 0, 0.1)",textColor:"rgba(0, 0, 0, 0.3)",iconOpacity:.25},press:{scale:.94,brightness:.92,time:.15},ripple:{color:"",lightColor:White(.45),darkColor:Black(.12),time:.6},waiting:{clock:"ozden",contentOpacity:.18,clockSize:30,space:14,dots:{size:6,gap:4,color:"indianred"}}}},SmartButton=function(t={}){SmartButton.applyLook(t);const o=""!==t.labelText;"top"===t.iconPosition&&o&&void 0===t.height&&(t.height="auto"),mergeIntoIfMissing(t,SmartButtonDefaults);const e=!o&&"number"==typeof t.height;e&&"auto"===t.width&&(t.width=t.height);const n=startObject(t);let r=null,i=null,a=null,l=0,c=0,s=0,u=0,d=0;const m=function(t,o){const e=null==o?"":String(o);1==n.allowHtml?t.text=e:t.plainText=e},b=function(){return 1==n.enabled&&1!=n.waiting},h=function(){return SmartButton.isReducedMotion()},g=function(){return 1==n.animated&&!h()},f=function(){const t=1==n.enabled,o=function(){const t=n.style,o={color:t.box.color,border:t.box.border,borderColor:t.box.borderColor,boxShadow:t.box.boxShadow,textColor:t.label.textColor,iconOpacity:t.icon.opacity,iconFilter:t.icon.filter};return 1!=n.enabled?Object.assign(o,t.disabled,{boxShadow:"none"}):1==n.isAsking?Object.assign(o,t.ask.button):(c&&1!=n.waiting&&(o.color=t.hover.color,t.hover.borderColor&&(o.borderColor=t.hover.borderColor)),o)}();n.color=o.color,n.border=o.border,n.borderColor=o.borderColor,n.boxShadow=o.boxShadow,n.css=function(){const t=s&&b()&&g();return{transform:t?"scale("+n.style.press.scale+")":"none",filter:t?"brightness("+n.style.press.brightness+")":"none"}}(),n.label&&(n.label.textColor=o.textColor),n.icon&&(n.icon.opacity=o.iconOpacity,n.icon.css={filter:o.iconFilter}),n.layout.css={filter:t?"none":"grayscale(1)"},n.layout.opacity=1==n.waiting?n.style.waiting.contentOpacity:1,n.cursor=t?"pointer":"default",n.tabIndex=t?0:-1,n.aria={disabled:!t,label:n.ariaLabel||n.labelText||""}},p=function(){const t=n.style;n.props(t.box),n.layout.props(t.layout),function(){if(e)return void(n.layout.padding=0);const t=n.style.layout,o=n.icon&&n.label&&"top"!==n.iconPosition,r=Array.isArray(t.padding)?t.padding[0]:t.padding,i=o?t.iconSideTrim:0;n.layout.css={paddingLeft:Math.max(0,r-i)+"px"}}(),n.icon&&n.icon.props(t.icon),n.label&&n.label.props(t.label),n.setFocusRing(t.focus.ringColor),f()},B=function(t){b()&&(1==n.isAsking&&function(t){return!!(t&&t.detail>1)||Date.now()-l<400}(t)||"function"==typeof n.onBeforeClick&&!1===n.onBeforeClick(n)||(n.ask&&1!=n.isAsking?S():(n.cancelAsk(),n.onClick&&n.onClick(n,t))))},S=function(){SmartButton.askingButton&&SmartButton.askingButton.cancelAsk(),SmartButton.askingButton=n,n.isAsking=1,l=Date.now(),f(),"undefined"!=typeof Tooltip&&(a=Tooltip.show(n,n.ask,n.style.ask.bubble)),i=n.after(n.style.ask.time,n.cancelAsk)},y=function(t){if(1!=n.ripple||!b()||h())return;const o=n.elem,e=function(t){const o=n.elem;if(!t||void 0===t.clientX)return{x:o.clientWidth/2,y:o.clientHeight/2};const e=o.getBoundingClientRect(),r=e.width?o.offsetWidth/e.width:1,i=e.height?o.offsetHeight/e.height:1;return{x:(t.clientX-e.left)*r-o.clientLeft,y:(t.clientY-e.top)*i-o.clientTop}}(t),r=Math.hypot(Math.max(e.x,o.clientWidth-e.x),Math.max(e.y,o.clientHeight-e.y)),i=document.createElement("span");i.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; border-radius: inherit; pointer-events: none;";const a=document.createElement("span");a.style.cssText="position: absolute; border-radius: 50%; pointer-events: none; background: "+function(){const t=n.style.ripple;return t.color?t.color:SmartButton.isDarkColor(getComputedStyle(n.elem).backgroundColor)?t.lightColor:t.darkColor}()+"; left: "+(e.x-r)+"px; top: "+(e.y-r)+"px; width: "+2*r+"px; height: "+2*r+"px;",i.appendChild(a),o.insertBefore(i,n.waitingCover?n.waitingCover.elem:null);a.animate([{transform:"scale(0)",opacity:1},{transform:"scale(1)",opacity:.7,offset:.6},{transform:"scale(1)",opacity:0}],{duration:1e3*n.style.ripple.time,easing:"cubic-bezier(0.2, 0.6, 0.35, 1)"}).onfinish=function(){i.remove()}},k=function(){if(!d)return;const t=n.style.press.time+"s",o=g()?"transform "+t+", filter "+t+", box-shadow "+t+", ":"";n.setMotionNow(o+"background-color 0.2s")},C=function(){const t=n.waitingCover.icon;if("clock"==n.waitingType){const o=n.style.waiting,e=Math.min(n.width,n.height)-o.space,r=basic.clamp(e,0,o.clockSize);t.setSize(r,r)}t.center()},x=function(){n.cancelAsk(),n.waiting=1,n.aria={busy:!0},n.waitingCover||(saveCurrentThat(),n.waitingCover=createIn(n,function(){const t=startBox(0,0,"100%","100%",{color:"transparent",clickable:1,cursor:"progress"});if("dots"==n.waitingType)t.icon=SmartButton.createDots(n.style.waiting.dots);else{const o=SmartButton.clocks[n.style.waiting.clock]||SmartButton.clocks.ozden;t.icon=Box(0,0,0,0,{color:"transparent",html:SmartButton.createClockSvg(o)})}return endBox(),t}),restoreThatFromSaved(),n.onResize(function(){1==n.waiting&&C()})),n.waitingCover.visible=1,C(),f()},T=function(){n.waiting=0,n.aria={busy:!1},n.waitingCover.visible=0,f(),"function"==typeof n.onWaitingEnd&&n.onWaitingEnd(n)};n.isAsking=0,n.setLabelText=function(t){n.labelText=t,n.label&&m(n.label,t),f()},n.setIcon=function(t){n.iconFile=t,n.icon&&n.icon.load(t)},n.setAnimated=function(t){n.animated=basic.isOn(t)?1:0,k(),f()},n.setRipple=function(t){n.ripple=basic.isOn(t)?1:0},n.setEnabled=function(t){n.enabled=basic.isOn(t)?1:0,1!=n.enabled&&(n.cancelAsk(),s=0,u=0),f()},n.cancelAsk=function(){1==n.isAsking&&(n.isAsking=0,i&&i(),i=null,a&&a.remove(),a=null,SmartButton.askingButton===n&&(SmartButton.askingButton=null),f())},n.setAsk=function(t){n.ask=t||"",n.ask||n.cancelAsk()},n.press=function(){B(null)};const w=n.remove;return n.superRemove=w,n.remove=function(){n.isRemoved||(n.cancelAsk(),w.call(n))},n.setStyle=function(t){Object.keys(t||{}).forEach(function(o){const e={};mergeIntoIfMissing(e,t[o]),mergeIntoIfMissing(e,n.style[o]),n.style[o]=e}),p(),k()},n.setTone=function(t){n.tone=t||"",n.setStyle(SmartButton.getToneStyle(n.tone,n.styleName))},n.setWaiting=function(t,o=0){r&&r(),r=null,basic.isOn(t)?x():1==n.waiting&&(o<=0?T():r=n.after(o,T))},n.clickable=1,n.role="button",n.layout=AutoLayout({flow:"top"===n.iconPosition?"vertical":"horizontal",width:"auto"===t.width?"auto":"100%",height:"auto"===t.height?"auto":"100%",position:"relative",...n.style.layout}),n.iconFile&&(n.icon=Icon(0,0,n.style.icon),n.icon.load(n.iconFile)),n.labelText&&(n.label=Label(0,0,n.style.label),m(n.label,n.labelText),n.label.css.whiteSpace="nowrap"),endAutoLayout(),p(),requestAnimationFrame(function(){n._isRemoved||(n.elem.offsetWidth,d=1,n.layout.setMotionNow("opacity 0.2s"),k())}),n.on("click",function(t,o){B(o)}),n.on("keydown",function(t,o){if("Enter"==o.key){if(o.preventDefault(),o.repeat)return;y(null),B(o)}" "==o.key&&(o.preventDefault(),u=1)}),n.on("keyup",function(t,o){" "==o.key&&u&&(u=0,y(null),B(o))}),n.on("blur",function(){u=0}),n.onHoverChange(function(t,o){c=o,o||(s=0),f()}),n.on("mousedown",function(t,o){o.preventDefault(),b()&&0===o.button&&(s=1,f(),y(o))}),n.on("mouseup",function(){s=0,f()}),1==n.waiting&&n.setWaiting(1),endObject(n)};SmartButton.askingButton=null,SmartButton.isReducedMotion=function(){return!!window.matchMedia&&(SmartButton.reducedMotionQuery||(SmartButton.reducedMotionQuery=window.matchMedia("(prefers-reduced-motion: reduce)")),SmartButton.reducedMotionQuery.matches)},SmartButton.DARK_LIMIT=.45,SmartButton.isDarkColor=function(t){const o=String(t).trim(),e=/^color\(srgb\s/.test(o);if(!e&&!/^rgba?\(/.test(o))return 0;const n=e?255:1,r=(e?o.slice(11):o).match(/[\d.]+/g);if(!r||r.length<3)return 0;if((r.length>3?parseFloat(r[3]):1)<.5)return 0;for(let t=0;t<3;t++)r[t]=parseFloat(r[t])*n;return(.299*r[0]+.587*r[1]+.114*r[2])/255<SmartButton.DARK_LIMIT?1:0},SmartButton.injectCss=function(){basic.addCss("smart-button-css","@keyframes smart-button-turn { to { transform: rotate(360deg); } }@keyframes smart-button-dot { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.35; } 40% { transform: scale(1); opacity: 1; } }.smart-button-hand { transform-box: view-box; transform-origin: 50% 50%; animation-name: smart-button-turn; animation-timing-function: linear; animation-iteration-count: infinite; }@media (prefers-reduced-motion: reduce) { .smart-button-hand, .smart-button-dot { animation: none !important; } }")},SmartButton.WHITE_ICON="brightness(0) invert(1)",SmartButton.ROUND=100,SmartButton.EDGE_WIDTH=2,SmartButton.styles={ozden:SmartButtonDefaults.style,ozden2:{box:{boxShadow:"none"}},ozden3:{box:{borderColor:Black(.1),boxShadow:"none"}},ozden4:{box:{color:White(0),border:0,borderColor:"transparent",boxShadow:"none"}},pill:{layout:{gap:10,padding:[18,0]},icon:{width:26,height:26,opacity:1},label:{fontSize:18,fontFamily:"opensans-bold"},box:{border:0,borderColor:"transparent",round:SmartButton.ROUND,boxShadow:"none"}},outlined:{layout:{gap:8,padding:[14,0]},icon:{width:26,height:26,opacity:1},label:{fontSize:18},box:{border:SmartButton.EDGE_WIDTH,round:SmartButton.ROUND,boxShadow:"inset 0 -"+SmartButton.EDGE_WIDTH+"px 0 "+Black(.35)}}},SmartButton.DARK_EDGE=White(.2),SmartButton.DARK_BOTTOM_LINE="inset 0 -2px 0 "+White(.12),SmartButton.createDarkTemplate=function(t,o="#383835"){return{box:Object.assign({color:"#2E2E2C",borderColor:SmartButton.DARK_EDGE,boxShadow:SmartButton.DARK_BOTTOM_LINE},t),hover:{color:o},label:{textColor:White(.85)},icon:{opacity:.85,filter:SmartButton.WHITE_ICON},focus:{ringColor:"rgba(101, 162, 147, 0.75)"},disabled:{color:"#232322",borderColor:White(.06),textColor:White(.28),iconOpacity:.25},press:{brightness:.88},waiting:{clock:"ozdenDark",dots:{color:"#F1C74A"}}}},SmartButton.styles.ozdenDark=SmartButton.createDarkTemplate({}),SmartButton.styles.ozden2Dark=SmartButton.createDarkTemplate({boxShadow:"none"}),SmartButton.styles.ozden3Dark=SmartButton.createDarkTemplate({borderColor:White(.1),boxShadow:"none"}),SmartButton.styles.ozden4Dark=SmartButton.createDarkTemplate({color:White(0),border:0,borderColor:"transparent",boxShadow:"none"},White(.08)),SmartButton.MINIMAL_DANGER="#C24A36",SmartButton.createMinimalTemplate=function(t){const o=SmartButton.MINIMAL_DANGER;return{height:28,style:{layout:{gap:6,padding:[10,0],iconSideTrim:0},icon:{width:14,height:14,opacity:1,filter:t.iconFilter},label:{fontSize:13,textColor:t.text},box:{color:"transparent",border:1,borderColor:t.line,round:4,boxShadow:"none"},hover:{color:"transparent",borderColor:t.lineHover},focus:{ringColor:t.focus},disabled:{color:"transparent",borderColor:t.disabledLine,textColor:t.disabledText,iconOpacity:.4},press:{scale:.97,brightness:1},waiting:{clock:t.clock,contentOpacity:.12,clockSize:16,space:6},ask:{button:{color:o,borderColor:o,boxShadow:"none",textColor:"white",iconFilter:SmartButton.WHITE_ICON},bubble:{color:o,textColor:"white",fontSize:12,bold:0,round:4,padding:[8,4],border:0,borderColor:"",shadow:"none",arrow:8,gap:4,edge:6}}}}},SmartButton.styles.minimal=SmartButton.createMinimalTemplate({text:Black(.85),line:Black(.2),lineHover:Black(.45),focus:"#3D8BD9",disabledLine:Black(.08),disabledText:Black(.34),iconFilter:"none",clock:"minimal"}),SmartButton.styles.minimalDark=SmartButton.createMinimalTemplate({text:White(.88),line:White(.18),lineHover:White(.42),focus:"#7FB6DE",disabledLine:White(.07),disabledText:White(.35),iconFilter:SmartButton.WHITE_ICON,clock:"minimalDark"}),SmartButton.styles.minimalDanger=SmartButton.createMinimalTemplate({text:"#C24A36",line:"rgba(194, 74, 54, 0.5)",lineHover:"#C24A36",focus:"#3D8BD9",disabledLine:Black(.08),disabledText:Black(.34),iconFilter:"none",clock:"minimal"}),SmartButton.styles.minimalDangerDark=SmartButton.createMinimalTemplate({text:"#FF9F93",line:"rgba(255, 159, 147, 0.5)",lineHover:"#FF9F93",focus:"#7FB6DE",disabledLine:White(.07),disabledText:White(.35),iconFilter:"none",clock:"minimalDark"}),SmartButton.DARK_TEXT=Black(.75),SmartButton.LIGHT_TEXT=White(.9),SmartButton.tones={white:{color:"white",hover:"whitesmoke",text:SmartButton.DARK_TEXT},cyan:{color:"#5BBAC1",hover:"#50AEB5",text:SmartButton.DARK_TEXT},orange:{color:"#DE815B",hover:"#D4724B",text:SmartButton.DARK_TEXT},yellow:{color:"#F1C74A",hover:"#E6BB3C",text:SmartButton.DARK_TEXT},green:{color:"#7BC362",hover:"#70B756",text:SmartButton.DARK_TEXT},blue:{color:"#52A8D0",hover:"#479CC4",text:SmartButton.DARK_TEXT},cyanDark:{color:"#376265",hover:"#3C6F72",text:SmartButton.LIGHT_TEXT},orangeDark:{color:"#724837",hover:"#82513C",text:SmartButton.LIGHT_TEXT},yellowDark:{color:"#7B682F",hover:"#8C7633",text:SmartButton.LIGHT_TEXT},greenDark:{color:"#46663A",hover:"#4D7440",text:SmartButton.LIGHT_TEXT},blueDark:{color:"#335A6B",hover:"#38657A",text:SmartButton.LIGHT_TEXT},ink:{color:"#1F1F1F",hover:"#3A3A3A",text:SmartButton.LIGHT_TEXT,edge:"#1F1F1F",hoverEdge:"#3A3A3A"},inkDark:{color:"#EDEDEB",hover:"#FFFFFF",text:"#1A1A19",edge:"#EDEDEB",hoverEdge:"#FFFFFF"}},SmartButton.applyLook=function(t){return SmartButton.applyTone(t),basic.applyStylePackage(t,SmartButton.styles,SmartButtonDefaults),mergeIntoIfMissing(t.style,SmartButtonDefaults.style),t},SmartButton.getToneStyle=function(t,o){if(!t)return SmartButton.getTemplateColors(o);const e=SmartButton.tones[t];if(!e)return console.warn("SmartButton: tone not found: "+t),{};const n=e.text===SmartButton.LIGHT_TEXT,r={box:{color:e.color},hover:{color:e.hover},label:{textColor:e.text},icon:{filter:n?SmartButton.WHITE_ICON:"none"}};return e.edge&&(r.box.borderColor=e.edge,r.hover.borderColor=e.hoverEdge||e.edge),r},SmartButton.getTemplateColors=function(t){const o=SmartButton.applyLook({styleName:t}).style;return{box:{color:o.box.color},hover:{color:o.hover.color},label:{textColor:o.label.textColor},icon:{filter:o.icon.filter}}},SmartButton.applyTone=function(t){if(!t.tone)return;const o={};mergeIntoIfMissing(o,t.style||{}),mergeIntoIfMissing(o,SmartButton.getToneStyle(t.tone)),t.style=o},SmartButton.clocks={ozden:{faceColor:"#FFFFFF",lineColor:"#141414",edgeWidth:2,hourWidth:2,hourLength:7.5,minuteWidth:2,minuteLength:10,minuteColor:"indianred",centerColor:"indianred",centerSize:4,minuteTurn:1.6,hourTurn:19.2}},SmartButton.clocks.ozdenDark=Object.assign({},SmartButton.clocks.ozden,{faceColor:"#2A2A2A",lineColor:"rgba(255, 255, 255, 0.9)",hourColor:"rgba(255, 255, 255, 0.6)",minuteColor:"#F1C74A",centerColor:"#F1C74A"}),SmartButton.clocks.minimal={isRing:1,lineColor:Black(.85),edgeWidth:3,trackOpacity:.2,turnTime:.8},SmartButton.clocks.minimalDark=Object.assign({},SmartButton.clocks.minimal,{lineColor:White(.88)}),SmartButton.CLOCK_SIZE=30,SmartButton.createClockSvg=function(t){if(SmartButton.injectCss(),t.isRing)return SmartButton.createRingSvg(t);const o=t,e=SmartButton.CLOCK_SIZE,n=e/2,r=n-o.edgeWidth/2,i=function(t,o,e,r,i){return'<line class="smart-button-hand" x1="'+n+'" y1="'+n+'" x2="'+t+'" y2="'+o+'" stroke="'+r+'" stroke-width="'+e+'" stroke-linecap="round" style="animation-duration: '+i+'s"/>'};return'<svg viewBox="0 0 '+e+" "+e+'" width="100%" height="100%" aria-hidden="true" style="display: block"><circle cx="'+n+'" cy="'+n+'" r="'+r+'" fill="'+o.faceColor+'" stroke="'+o.lineColor+'" stroke-width="'+o.edgeWidth+'"/>'+i(n+o.hourLength,n,o.hourWidth,o.hourColor||o.lineColor,o.hourTurn)+i(n,n-o.minuteLength,o.minuteWidth,o.minuteColor,o.minuteTurn)+'<circle cx="'+n+'" cy="'+n+'" r="'+o.centerSize/2+'" fill="'+o.centerColor+'"/></svg>'},SmartButton.createRingSvg=function(t){const o=SmartButton.CLOCK_SIZE,e=o/2,n=e-t.edgeWidth/2,r="M"+e+" "+(e-n)+" A"+n+" "+n+" 0 0 1 "+(e+n)+" "+e;return'<svg viewBox="0 0 '+o+" "+o+'" width="100%" height="100%" aria-hidden="true" style="display: block"><circle cx="'+e+'" cy="'+e+'" r="'+n+'" fill="none" stroke="'+t.lineColor+'" stroke-opacity="'+t.trackOpacity+'" stroke-width="'+t.edgeWidth+'"/><path class="smart-button-hand" d="'+r+'" fill="none" stroke="'+t.lineColor+'" stroke-width="'+t.edgeWidth+'" stroke-linecap="round" style="animation-duration: '+t.turnTime+'s"/></svg>'},SmartButton.DOT_COUNT=3,SmartButton.DOT_TIME=1.2,SmartButton.DOT_DELAY=.16,SmartButton.createDots=function(t){SmartButton.injectCss();const o=HGroup({hug:1,align:"center center",gap:t.gap});for(let o=0;o<SmartButton.DOT_COUNT;o++){const e=Box({width:t.size,height:t.size,color:t.color,round:100});e.elem.classList.add("smart-button-dot"),e.css={animation:"smart-button-dot "+SmartButton.DOT_TIME+"s ease-in-out "+o*SmartButton.DOT_DELAY+"s infinite"}}return endGroup(),o};
|
|
4
|
+
;
|
|
5
|
+
/* Bismillah */
|
|
6
|
+
"use strict";const BreadcrumbsDefaults={key:"0",width:"auto",height:"auto",items:[],separator:"chevron",maxItems:0,itemsBeforeCollapse:1,itemsAfterCollapse:2,maxItemWidth:180,wrap:0,trimOnClick:0,currentClickable:0,enabled:1,ariaLabel:"Breadcrumb",onClick:function(t,e,n){},onChange:function(t){},style:{layout:{gap:4},item:{fontSize:14,textColor:Black(.55),color:"transparent",round:6,padding:[6,3]},itemHover:{textColor:Black(.9),color:Black(.05)},current:{textColor:Black(.85),fontFamily:"opensans-bold"},separator:{fontSize:14,textColor:Black(.3),size:6},icon:{width:16,height:16},focus:{color:"#3871E0"},disabled:{opacity:.4}}},Breadcrumbs=function(t={}){mergeIntoIfMissing(t,BreadcrumbsDefaults),t.color="transparent",t.height="auto";const e="auto"===String(t.width);let n=startObject(t);const o=n.style;let i=[],r=0;n.items=[];const a=function(t){return"string"==typeof t||"number"==typeof t?{text:String(t)}:Object.assign({text:""},t)},l=function(){const t=function(){const t=o.item.padding;if(!Array.isArray(t)){const e=basic.num(t)||0;return[e,e]}const e=t.length>1?t[1]:t[0];return[t[0],e]}();return t[1]+"px "+t[0]+"px"},c=function(t,e){const n=e?o.itemHover:o.item;t.color=n.color,t.label.textColor=n.textColor},s=function(t,e){t.role="link",t.tabIndex=1==n.enabled?0:-1,t.cursor=1==n.enabled?"pointer":"default",t.css.outline="none",t.clickable=1,t.on("click",function(t,o){1==n.enabled&&e(o)}),t.on("keydown",function(t,o){"Enter"!==o.key&&" "!==o.key||(o.preventDefault(),1==n.enabled&&e(o))}),function(t){t.on("focus",function(){t.elem.matches(":focus-visible")&&(t.boxShadow="0 0 0 2px "+o.focus.color)}),t.on("blur",function(){t.boxShadow="none"})}(t)},u=function(){i.forEach(function(t){t.remove()}),i=[],function(t,e){const n=getDefaultContainerBox();setDefaultContainerBox(t),e(),setDefaultContainerBox(n)}(n.content,function(){(function(){const t=n.items.length,e=Math.max(1,n.itemsBeforeCollapse),o=Math.max(1,n.itemsAfterCollapse),i=n.items.map(function(t,e){return{type:"item",item:t,index:e}});return n.maxItems>0&&t>n.maxItems&&t-e-o>=2&&!r?i.slice(0,e).concat([{type:"ellipsis"}]).concat(i.slice(t-o)):i})().forEach(function(t,e){setDefaultContainerBox(n.content),e>0&&i.push(function(){let t;if("chevron"==n.separator){const e=o.separator.size;t=Box({width:e,height:e,color:"transparent"}),t.css={borderTop:"1.5px solid "+o.separator.textColor,borderRight:"1.5px solid "+o.separator.textColor,transform:"rotate(45deg)",margin:"0 "+Math.round(e/2+2)+"px 0 "+Math.round(e/2)+"px"}}else t=Label({plainText:n.separator,fontSize:o.separator.fontSize,textColor:o.separator.textColor}),t.css={whiteSpace:"nowrap",padding:"0 2px"};return t.shrink=0,t.aria={hidden:"true"},t}()),setDefaultContainerBox(n.content),"ellipsis"==t.type?i.push(function(){const t=Label({text:"…",fontSize:o.item.fontSize,textColor:o.item.textColor,color:o.item.color,round:o.item.round});return t.css.padding=l(),t.shrink=0,t.elem.title="Show all",t.aria={label:"Show all items"},s(t,function(){n.expand()}),t.on("mouseenter",function(){1==n.enabled&&(t.color=o.itemHover.color,t.textColor=o.itemHover.textColor)}),t.on("mouseleave",function(){t.color=o.item.color,t.textColor=o.item.textColor}),t}()):i.push(function(t,e){const i=e==n.items.length-1,r=!i||1==n.currentClickable,a=HGroup({width:"auto",height:"auto",align:"left center",gap:6,color:o.item.color,round:o.item.round});return a.css={padding:l(),minWidth:"0"},a.shrink=i?1:0,a.setMotion("background-color 0.15s"),a.item=t,a.index=e,t.iconFile&&(a.icon=Icon({width:o.icon.width,height:o.icon.height}),a.icon.shrink=0,a.icon.elem.alt="",a.icon.load(t.iconFile)),a.label=Label({plainText:t.text,fontSize:o.item.fontSize,textColor:i?o.current.textColor:o.item.textColor}),i&&o.current.fontFamily&&(a.label.css.fontFamily=o.current.fontFamily),a.label.ellipsis=1,n.maxItemWidth>0&&(a.label.css.maxWidth=n.maxItemWidth+"px"),t.text&&(a.elem.title=t.text),endGroup(),i&&(a.aria={current:"page"}),r&&(s(a,function(t){n.clickItem(e,t)}),a.on("mouseenter",function(){1==n.enabled&&c(a,1)}),a.on("mouseleave",function(){c(a,0),i&&(a.label.textColor=o.current.textColor)})),a}(t.item,t.index))})}),m()},m=function(){n.opacity=1==n.enabled?1:o.disabled.opacity,n.content.css.flexWrap=1==n.wrap?"wrap":"nowrap",n.aria={disabled:1==n.enabled?"false":"true"}},f=function(t){n.items=(t||[]).map(a),r=0,u()};return n.setItems=function(t,e=0){f(t),e||n.onChange(n)},n.getItems=function(){return n.items.slice()},n.getCurrentItem=function(){return n.items[n.items.length-1]||null},n.addItem=function(t){n.items.push(a(t)),u(),n.onChange(n)},n.goTo=function(t){t<0||t>=n.items.length-1||(n.items=n.items.slice(0,t+1),r=0,u(),n.onChange(n))},n.back=function(){n.goTo(n.items.length-2)},n.clickItem=function(t,e){const o=n.items[t];if(!o||1!=n.enabled)return;const i=n.onClick(n,o,t,e);1==n.trimOnClick&&n.goTo(t),o.url&&!1!==i&&basic.go(o.url)},n.expand=function(){if(r)return;r=1,u();const t=i.find(function(t){return t.index==Math.max(1,n.itemsBeforeCollapse)});t&&1==n.enabled&&t.elem.focus()},n.collapse=function(){r&&(r=0,u())},n.setSeparator=function(t){n.separator=t,u()},n.setMaxItems=function(t){n.maxItems=basic.num(t),r=0,u()},n.setEnabled=function(t){n.enabled=basic.isOn(t)?1:0,u()},n.refresh=function(){u()},n.role="navigation",n.aria={label:n.ariaLabel},n.content=HGroup({width:e?"auto":"100%",height:"auto",align:"left center",gap:o.layout.gap,position:"relative"}),endGroup(),n.enabled=basic.isOn(n.enabled)?1:0,f(t.items),endObject(n)};Breadcrumbs.escapeHtml=basic.escapeHtml,Breadcrumbs.fromPath=function(t,e="Home",n="/"){const o=String(t).split(n).filter(function(t){return""!==t}),i=[{text:e,key:n}];let r="";return o.forEach(function(t){r+=n+t;let e=t;try{e=decodeURIComponent(t)}catch(t){}i.push({text:e,key:r})}),i};
|
|
7
|
+
;
|
|
8
|
+
/* Bismillah */
|
|
9
|
+
"use strict";const CheckBoxDefaults={key:"0",width:"auto",height:"auto",checked:0,enabled:1,labelText:"",allowHtml:0,labelPosition:"right",wrapLabel:0,animated:0,onChange:function(o){},styleName:"light",style:{box:{color:"transparent",round:0},hoverBox:{color:null},checkedBox:{color:null},hoverCheckedBox:{color:null},layout:{gap:10,padding:[0,4],align:"left center"},mark:{width:22,height:22,color:White(1),border:2,borderColor:Black(.35),round:5},checkedMark:{color:"#242424",borderColor:"#242424"},hoverMark:{color:null,borderColor:Black(.7)},tick:{color:White(1),thickness:2},label:{fontSize:16,textColor:Black(.8)},disabled:{opacity:.4},focus:{ringColor:""}}},CheckBox=function(o={}){basic.applyStylePackage(o,CheckBox.styles,CheckBoxDefaults),mergeIntoIfMissing(o,CheckBoxDefaults),o.color=o.style.box.color,o.round=o.style.box.round;let e=startObject(o),r=0;const t="0.15s",c="0.25s",l="cubic-bezier(0.2, 0.8, 0.2, 1)";let a=0;const n=function(o,r){const t=null==r?"":String(r);1==e.allowHtml?o.text=t:o.plainText=t},s=function(){return 1==e.animated&&!(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)},i=function(){const o=s()?c+" "+l:t;s()?(e.mark.css={transformOrigin:"left"===e.labelPosition?"right center":"left center"},e.mark.setMotion("background-color 0.15s, border-color 0.15s, transform 0.25s "+l),e.tick.css={transition:"transform "+o+", opacity "+o},a=1):a&&(e.mark.setMotionNow("background-color 0.15s, border-color "+t),e.mark.css={transform:"none"},e.tick.css={transition:"transform "+o+", opacity "+o},a=0),d()},d=function(){const o=r&&1==e.enabled;e.color=function(o){const r=e.style.box.color,t=e.style.checkedBox.color||r;return 1==e.checked?o&&e.style.hoverCheckedBox.color||t:o&&e.style.hoverBox.color||r}(o),function(o){if(1==e.checked)return e.mark.color=e.style.checkedMark.color,e.mark.borderColor=e.style.checkedMark.borderColor,void(e.tick.css={opacity:"1",transform:"rotate(45deg) scale(1)"});const r=e.style.hoverMark.color;e.mark.color=o&&r?r:e.style.mark.color,e.mark.borderColor=o?e.style.hoverMark.borderColor:e.style.mark.borderColor;const t=s()?.6:.4;e.tick.css={opacity:"0",transform:"rotate(45deg) scale("+t+")"}}(o),function(){const o=1==e.enabled;e.opacity=o?1:e.style.disabled.opacity,e.cursor=o?"pointer":"default",e.tabIndex=o?0:-1}(),s()&&(e.mark.css={transform:r&&1==e.enabled?"scale(1.05)":"none"}),e.aria={checked:1==e.checked,disabled:1!=e.enabled}};e.setChecked=function(o,r=0){o=basic.isOn(o)?1:0,e.checked!=o&&(e.checked=o,d(),r||e.onChange(e))},e.toggle=function(){1==e.enabled&&e.setChecked(1==e.checked?0:1)},e.setEnabled=function(o){e.enabled=basic.isOn(o)?1:0,d()},e.setLabelText=function(o){e.labelText=o,n(e.label,o),e.label.visible=o?1:0},e.refresh=function(){d()},e.setAnimated=function(o){e.animated=1==o?1:0,i()},e.clickable=1,e.role="checkbox",e.css={outline:"none",userSelect:"none"},e.setMotion("background-color "+t);const k=basic.isOn(e.wrapLabel);k&&(e.css={minWidth:"0px"}),e.contentBox=HGroup({width:k?"100%":"auto",height:"auto",position:"relative",...e.style.layout});const h=function(){e.label=Label(e.style.label),n(e.label,e.labelText),e.labelText||(e.label.visible=0),k?(e.label.grow=1,e.label.css={minWidth:"0px",whiteSpace:"normal",overflowWrap:"anywhere"}):e.label.css.whiteSpace="nowrap"};"left"===e.labelPosition&&h(),e.mark=startBox({width:e.style.mark.width,height:e.style.mark.height,color:e.style.mark.color,border:e.style.mark.border,borderColor:e.style.mark.borderColor,round:e.style.mark.round}),e.mark.setMotion("background-color 0.15s, border-color "+t),e.mark.css.boxSizing="border-box",function(){const o=e.style.focus.ringColor;o&&(CheckBox.addFocusCss(),e.elem.classList.add("check-box-focus"),e.mark.elem.classList.add("check-box-mark"),e.elem.style.setProperty("--check-box-focus",o))}(),e.mark.shrink=0;const b=e.style.mark.width-2*e.style.mark.border,u=e.style.mark.height-2*e.style.mark.border,m=Math.round(.3*b),x=Math.round(.58*u),f=e.style.tick.thickness+"px solid "+e.style.tick.color;return e.tick=Box({left:Math.round((b-m)/2),top:Math.round((u-x)/2)-Math.round(.06*u),width:m,height:x,color:"transparent"}),e.tick.css={boxSizing:"border-box",borderRight:f,borderBottom:f,transition:"transform 0.15s, opacity "+t},endBox(),"left"!==e.labelPosition&&h(),endGroup(),e.on("click",function(o,r){e.toggle()}),e.on("keydown",function(o,r){" "!==r.key&&"Enter"!==r.key||(r.preventDefault(),r.repeat||e.toggle())}),e.on("mouseover",function(){r=1,1==e.enabled&&d()}),e.on("mouseout",function(){r=0,d()}),e.checked=basic.isOn(e.checked)?1:0,e.enabled=basic.isOn(e.enabled)?1:0,i(),endObject(e)};CheckBox.styles={light:CheckBoxDefaults.style,modern:{box:{color:"transparent",round:8},hoverBox:{color:"whitesmoke"},checkedBox:{color:"#EFF5F6"},hoverCheckedBox:{color:"#DFECEC"},layout:{gap:12,padding:[12,10],align:"left center"},mark:{width:22,height:22,color:"whitesmoke",border:1,borderColor:Black(.7),round:4},checkedMark:{color:"white",borderColor:Black(.7)},hoverMark:{color:"white",borderColor:Black(.7)},tick:{color:"cadetblue",thickness:3},label:{fontSize:16,textColor:Black(.85)},disabled:{opacity:.4}},dark:{mark:{color:"#2A2A29",borderColor:White(.3)},checkedMark:{color:"#3D7A6B",borderColor:"#3D7A6B"},hoverMark:{borderColor:White(.6)},label:{textColor:White(.85)}}},CheckBox.styles.classic=CheckBox.styles.light,CheckBox.createMinimalStyle=function(o){return{layout:{gap:8,padding:[0,2],align:"left center"},mark:{width:14,height:14,color:"transparent",border:1,borderColor:o.line,round:3},checkedMark:{color:"transparent",borderColor:o.ink},hoverMark:{color:null,borderColor:o.lineHover},tick:{color:o.ink,thickness:1.5},label:{fontSize:13,textColor:o.text},disabled:{opacity:.4},focus:{ringColor:o.focus}}},CheckBox.MINIMAL_COLORS={line:Black(.45),lineHover:Black(.65),ink:"#1F1F1F",text:Black(.85),focus:"#3D8BD9"},CheckBox.styles.minimal=CheckBox.createMinimalStyle(CheckBox.MINIMAL_COLORS),CheckBox.MINIMAL_DARK_COLORS={line:White(.42),lineHover:White(.62),ink:"#EDEDEB",text:White(.88),focus:"#7FB6DE"},CheckBox.styles.minimalDark=CheckBox.createMinimalStyle(CheckBox.MINIMAL_DARK_COLORS),CheckBox.addFocusCss=function(){basic.addCss("check-box-focus",".check-box-focus:focus { outline: none; }.check-box-focus:focus-visible .check-box-mark { border-color: var(--check-box-focus) !important; box-shadow: inset 0 0 0 1px var(--check-box-focus); }")};
|
|
10
|
+
;
|
|
11
|
+
/* Bismillah */
|
|
12
|
+
"use strict";const SearchInputDefaults={left:0,top:0,width:300,height:50,searchIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23.707 22.293l-5.969-5.969a10.016 10.016 0 10-1.414 1.414l5.969 5.969a1 1 0 001.414-1.414zM10 18a8 8 0 118-8 8.009 8.009 0 01-8 8z"/></svg>'),clearIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144 56 56ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>'),searchIconSize:24,searchIconLeft:16,searchIconGap:8,clearIconRight:16,textEndSpace:null,showClearIcon:1,clearIconMinTextWidth:0,textFadeWidth:24,clearOnEscape:0,value:"",placeholder:"Search",color:"whitesmoke",textColor:"rgba(0, 0, 0, 0.8)",placeholderColor:"",searchIconOpacity:1,clearIconOpacity:.6,border:0,borderColor:"rgba(0, 0, 0, 0.1)",borderBottomStyle:"2px solid rgba(0, 0, 0, 0.06)",focusBorderColor:"",focusBorderWidth:2,round:6,fontSize:20,textOffsetY:0,clearIconOffsetY:0,searchIconOffsetY:0,invertIconColor:0,invertSearchIconColor:null,invertClearIconColor:null,animated:0,hoverRingColor:"rgba(0, 0, 0, 0.08)",focusRingColor:"rgba(0, 0, 0, 0.16)",onChange:function(e){},onEnter:function(e){},styleName:"ozden",style:{}},SearchInput=function(e={}){basic.applyStylePackage(e,SearchInput.styles,SearchInputDefaults);const t=void 0!==e.right&&void 0===e.left,o=void 0!==e.bottom&&void 0===e.top;mergeIntoIfMissing(e,SearchInputDefaults),t&&delete e.left,o&&delete e.top;const n=startObject(e);let r=0,c=0,a=0,l=0,i=0,s=null,h="";n.publicVar="";const u=function(){if(null!==n.textEndSpace){const e=n.searchIconLeft+n.searchIconSize+n.searchIconGap;return n.width-e-n.textEndSpace-20-n.clearIconRight}const e=n.searchIconLeft-SearchInputDefaults.searchIconLeft+(n.searchIconGap-SearchInputDefaults.searchIconGap),t=n.clearIconRight-SearchInputDefaults.clearIconRight;return n.width-80-e-t},d=function(){return!!n.showClearIcon&&(!n.clearIconMinTextWidth||u()>=n.clearIconMinTextWidth)},p=function(){const e=u();return(d()?e:e+16)+I()},I=function(){return c||!n.textFadeWidth?0:SearchInput.TEXT_UNDER_END},g=function(){n.txtSearch.width=p(),x()},f=function(e){e.txtSearch.center("top"),e.txtSearch.top+=e.textOffsetY,e.imgClearIcon.center("top"),e.imgClearIcon.top+=e.clearIconOffsetY,e.imgIcon.center("top"),e.imgIcon.top+=e.searchIconOffsetY},m=function(e){e.txtSearch.width=p(),f(e),k(),x()},x=function(){const e=n.txtSearch.inputElement,t=e.scrollLeft>0,o=e.scrollLeft+e.clientWidth<e.scrollWidth-1,r=e.selectionStart===e.value.length,a=n.textFadeWidth>0&&(!c||r)?S(t,o):"";n.txtSearch.css={maskImage:a,webkitMaskImage:a}},S=function(e,t){if(!e&&!t)return"";const o=n.textFadeWidth+"px",r=n.textFadeWidth+I()+"px";return"linear-gradient(to right, "+(e?"transparent 0px, #000 "+o:"#000 0px")+", "+(t?"#000 calc(100% - "+r+"), transparent 100%":"#000 100%")+")"},C=function(e){return null==e?1==n.invertIconColor:1==e},v=function(e){n.imgClearIcon.opacity=e?n.clearIconOpacity:0,n.imgClearIcon.clickable=e?1:0,y()},w=function(){if(1!=n.animated)return!1;return!(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)},y=function(){w()&&(n.boxShadow=c?"inset 0 0 0 2px "+n.focusRingColor:r?"inset 0 0 0 1px "+n.hoverRingColor:"inset 0 0 0 0 transparent",n.imgIcon.css.transform=i?"scale(1.14) rotate(-12deg)":c?"scale(1.06) rotate(-12deg)":r?"scale(1.08)":"none",n.imgIcon.opacity=function(){let e=0;return r&&(e=.25),c&&(e=.5),Math.min(1,n.searchIconOpacity+e)}(),n.imgClearIcon.css.transform=n.imgClearIcon.clickable?a?"rotate(90deg)":"none":"scale(0.6)")},b=function(){if(!w())return n.imgClearIcon.setMotion("opacity 0.3s"),void(l&&(l=0,n.setMotion(""),n.imgIcon.setMotion(""),n.boxShadow="",n.imgIcon.css.transform="",n.imgIcon.opacity=n.searchIconOpacity,n.imgClearIcon.css.transform=""));l=1;const e=function(e){return e.map(function(e){return e+" 0.25s cubic-bezier(0.2, 0.8, 0.2, 1)"}).join(", ")};n.setMotion(e(["box-shadow"])),n.imgIcon.setMotion(e(["transform","opacity"])),n.imgClearIcon.setMotion(e(["transform","opacity"])),y()},F=function(){if(!n.focusBorderColor)return;if(c?(h=n.borderColor,n.borderColor=n.focusBorderColor):(n.borderColor=h,n.css.borderBottom=n.borderBottomStyle),w())return;const e=n.focusBorderWidth-1;n.boxShadow=c&&e>0?"inset 0 0 0 "+e+"px "+n.focusBorderColor:""},k=function(){v(d()&&n.txtSearch.text.length>0)},O=function(){v(0),n.txtSearch.text="",n.value="",x(),n.onChange(n),n.onEnter(n)};return n.publicFunc=()=>{},n.setValue=function(e,t=0){const o=null==e?"":String(e);o!==n.txtSearch.text&&(n.txtSearch.text=o,n.value=o,k(),x(),t||n.onChange(n))},n.getValue=function(){return n.txtSearch.text},n.getSearchText=function(){return n.txtSearch.text.toLowerCase()},n.setPlaceholder=function(e){n.placeholder=e,n.txtSearch.inputElement.setAttribute("placeholder",e)},n.focus=function(){n.txtSearch.inputElement.focus()},n.setAnimated=function(e){n.animated=1==e?1:0,b()},n.setClearIconRight=function(e){n.clearIconRight=e,n.imgClearIcon.right=e,m(n)},n.css.borderBottom=n.borderBottomStyle,n.imgIcon=Icon(n.searchIconLeft,0,n.searchIconSize,n.searchIconSize,{opacity:n.searchIconOpacity,space:0}),that.load(n.searchIconFile),C(n.invertSearchIconColor)&&(that.css.filter="invert(100%)"),n.txtSearch=Input(n.searchIconLeft+n.searchIconSize+n.searchIconGap,0,{width:p(),height:n.height,border:0,minimal:1,fontSize:n.fontSize,textColor:n.textColor,color:"transparent"}),that.inputElement.style.paddingLeft="0px",that.inputElement.setAttribute("placeholder",n.placeholder),""!==n.placeholderColor&&(SearchInput.addPlaceholderStyle(),that.inputElement.setAttribute("data-placeholder-color","1"),that.inputElement.style.setProperty("--placeholder-color",n.placeholderColor)),n.imgClearIcon=Icon(5,0,20,20,{right:n.clearIconRight,opacity:0,space:0}),that.load(n.clearIconFile),C(n.invertClearIconColor)&&(that.css.filter="invert(100%)"),that.cursor="pointer",f(n),n.listenTo(n.txtSearch.inputElement,"input",function(){n.value=n.txtSearch.text,n.onChange(n),k(),x()}),n.listenTo(n.txtSearch.inputElement,"keyup",function(e,t){"Enter"===t.key&&n.onEnter(n),x()}),n.listenTo(n.txtSearch.inputElement,"scroll",x),n.listenTo(n.txtSearch.inputElement,"mouseup",x),n.listenTo(n.txtSearch.inputElement,"keydown",function(e,t){"Escape"!==t.key||t.isComposing||1==n.clearOnEscape&&""!==n.txtSearch.text&&(t.preventDefault(),t.stopPropagation(),O())}),n.value=null===n.value||void 0===n.value?"":String(n.value),n.txtSearch.text=n.value,n.onResize(m),n.imgClearIcon.onClick(O),n.imgClearIcon.onHoverChange(function(e,t){a=t,y()}),n.imgClearIcon.clickable=0,n.onHoverChange(function(e,t){r=t,y()}),n.listenTo(n.txtSearch.inputElement,"focus",function(){c=1,y(),F(),g()}),n.listenTo(n.txtSearch.inputElement,"input",function(){w()&&(s&&s(),i=1,y(),s=n.after(150,function(){i=0,s=null,y()}))}),n.listenTo(n.txtSearch.inputElement,"blur",function(){c=0,y(),F(),g()}),n.on("click",function(e,t){var o;t.target!==n.txtSearch.inputElement&&(((o=t.target)===n.elem||n.imgIcon.elem.contains(o)||n.txtSearch.elem.contains(o))&&n.focus())}),b(),endObject(n)};SearchInput.TEXT_UNDER_END=20,SearchInput.addPlaceholderStyle=function(){if(document.getElementById("searchInputPlaceholderStyle"))return;const e=document.createElement("style");e.id="searchInputPlaceholderStyle",e.textContent="input[data-placeholder-color]::placeholder { color: var(--placeholder-color); opacity: 1; }",document.head.appendChild(e)},SearchInput.getLineSearchIconFile=function(e){return"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="'+e+'" stroke-width="2" stroke-linecap="round"><circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L20 20"/></svg>')},SearchInput.getRoundClearIconFile=function(e,t){return"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9" fill="'+e+'"/><path d="M9 9l6 6M15 9l-6 6" fill="none" stroke="'+t+'" stroke-width="2" stroke-linecap="round"/></svg>')},SearchInput.styles={original:{style:{}},light:{style:{},searchIconFile:SearchInput.getLineSearchIconFile("#000000"),clearIconFile:SearchInput.getRoundClearIconFile("#A3A3A0","#FFFFFF"),searchIconSize:18,searchIconLeft:14,clearIconRight:12,searchIconOpacity:.55,clearIconOpacity:1,invertIconColor:0,color:"#FFFFFF",textColor:Black(.88),placeholderColor:Black(.38),fontSize:15,height:44,textOffsetY:-1,searchIconOffsetY:1,clearIconOffsetY:1,textEndSpace:6,border:1,borderColor:Black(.12),borderBottomStyle:"1px solid "+Black(.12),focusBorderColor:"#3D7A6B",round:10,animated:0,hoverRingColor:Black(.08),focusRingColor:"rgba(61, 122, 107, 0.5)"},dark:{style:{},searchIconFile:SearchInput.getLineSearchIconFile("#FFFFFF"),clearIconFile:SearchInput.getRoundClearIconFile("#7A7A78","#141414"),searchIconSize:18,searchIconLeft:14,clearIconRight:12,searchIconOpacity:.55,clearIconOpacity:1,invertIconColor:0,color:"#232322",textColor:White(.9),placeholderColor:White(.38),fontSize:15,height:44,textOffsetY:-1,searchIconOffsetY:1,clearIconOffsetY:1,textEndSpace:6,border:1,borderColor:White(.12),borderBottomStyle:"1px solid "+White(.12),focusBorderColor:"#65A293",round:10,animated:0,hoverRingColor:White(.08),focusRingColor:"rgba(101, 162, 147, 0.55)"},ozden:{style:{},searchIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23.707 22.293l-5.969-5.969a10.016 10.016 0 10-1.414 1.414l5.969 5.969a1 1 0 001.414-1.414zM10 18a8 8 0 118-8 8.009 8.009 0 01-8 8z"/></svg>'),clearIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#FFFFFF" stroke="rgba(0,0,0,0.12)" stroke-width="1"/><path d="M8 8l8 8M16 8l-8 8" fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round"/></svg>'),searchIconSize:24,searchIconOpacity:.4,clearIconOpacity:.6,invertIconColor:0,invertSearchIconColor:null,invertClearIconColor:null,color:"whitesmoke",textColor:"rgba(0, 0, 0, 0.8)",placeholderColor:"",fontSize:20,height:44,textOffsetY:-2,clearIconOffsetY:-1,border:1,borderColor:"rgba(0, 0, 0, 0.1)",borderBottomStyle:"3px solid rgba(0, 0, 0, 0.06)",round:50,animated:0,hoverRingColor:"rgba(0, 0, 0, 0.08)",focusRingColor:"rgba(0, 0, 0, 0.16)"},ozdenDark:{style:{},searchIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23.707 22.293l-5.969-5.969a10.016 10.016 0 10-1.414 1.414l5.969 5.969a1 1 0 001.414-1.414zM10 18a8 8 0 118-8 8.009 8.009 0 01-8 8z"/></svg>'),clearIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#FFFFFF" stroke="rgba(0,0,0,0.12)" stroke-width="1"/><path d="M8 8l8 8M16 8l-8 8" fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round"/></svg>'),searchIconSize:24,searchIconOpacity:.4,clearIconOpacity:.4,invertIconColor:null,invertSearchIconColor:1,invertClearIconColor:1,color:"#2B2D31",textColor:"rgba(255, 255, 255, 0.88)",placeholderColor:"rgba(255, 255, 255, 0.35)",fontSize:20,height:44,textOffsetY:-2,clearIconOffsetY:-1,border:1,borderColor:"rgba(255, 255, 255, 0.1)",borderBottomStyle:"3px solid rgba(255, 255, 255, 0.06)",round:50,animated:0,hoverRingColor:"rgba(255, 255, 255, 0.08)",focusRingColor:"rgba(255, 255, 255, 0.18)"}},SearchInput.styles.classic=SearchInput.styles.light,SearchInput.createMinimalStyle=function(e){const t=function(e){return"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>")};return{style:{},height:28,searchIconFile:t('<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>'),clearIconFile:t('<path d="M9 9l6 6M15 9l-6 6"/>'),searchIconSize:14,searchIconLeft:10,searchIconGap:6,clearIconRight:8,searchIconOpacity:.55,clearIconOpacity:.55,invertIconColor:e.invertIcons,color:"transparent",textColor:e.text,placeholderColor:e.placeholder,fontSize:13,textOffsetY:0,clearIconOffsetY:0,border:1,borderColor:e.edge,borderBottomStyle:"1px solid "+e.edge,focusBorderColor:e.ink,focusBorderWidth:1,round:14,animated:0}},SearchInput.MINIMAL_COLORS={invertIcons:0,text:Black(.85),placeholder:Black(.54),edge:Black(.45),ink:"#1F1F1F"},SearchInput.styles.minimal=SearchInput.createMinimalStyle(SearchInput.MINIMAL_COLORS),SearchInput.MINIMAL_DARK_COLORS={invertIcons:1,text:White(.88),placeholder:White(.48),edge:White(.42),ink:"#EDEDEB"},SearchInput.styles.minimalDark=SearchInput.createMinimalStyle(SearchInput.MINIMAL_DARK_COLORS);
|
|
13
|
+
;
|
|
14
|
+
/* Bismillah */
|
|
15
|
+
"use strict";const ContextMenuDefaults={key:"0",items:[],target:null,trigger:"contextmenu",minWidth:180,maxWidth:320,enabled:1,ariaLabel:"Menu",onClick:function(e,t,n){},onOpen:function(e){},onClose:function(e){},onSideKey:function(e,t){},parentMenu:null,styleName:"light",style:{menu:{color:"white",border:1,borderColor:Black(.12),round:8,padding:4,shadow:"0px 8px 24px "+Black(.14),zIndex:1e3},item:{height:32,fontSize:14,textColor:Black(.85),color:"transparent",round:5,padding:10,gap:10,border:0,borderColor:"transparent"},itemHover:{textColor:Black(.9),color:Black(.06),borderColor:""},disabled:{textColor:Black(.35),opacity:.4},icon:{width:16,height:16,opacity:.85},submenu:{arrowOpacity:.55,overlap:4},shortcut:{fontSize:12,opacity:.6,space:24},separator:{color:Black(.1),space:4}}},ContextMenu=function(e={}){basic.applyStylePackage(e,ContextMenu.styles,ContextMenuDefaults),mergeIntoIfMissing(e,ContextMenuDefaults);const t=e.style.menu;e.width="auto",e.height="auto",e.color=t.color,e.border=t.border,e.borderColor=t.borderColor,e.round=t.round,e.padding=t.padding,e.zIndex=t.zIndex,e.boxShadow=t.shadow;const n=getDefaultContainerBox();setDefaultContainerBox(page);let o=startObject(e);const i=o.style;let r=[],a=[],c=0,l=-1,s=null,u=0,m="";let d=-1;o.items=[],o.source=null;const h=function(e){return basic.isOn(e)?1:0},f=function(e){if("-"===e||e&&"separator"==e.type)return{type:"separator"};if("string"==typeof e||"number"==typeof e)return{type:"item",text:String(e),enabled:1};const t=Object.assign({text:"",enabled:1},e);return t.type="item",t.enabled=h(t.enabled),t},p=function(e){return!!(e&&"item"==e.type&&Array.isArray(e.items)&&e.items.length)},g=function(e){return"item"==e.type&&void 0!==e.checked&&null!==e.checked},b=function(){const e=r[d];return e&&e.submenu&&e.submenu.isOpen()?e.submenu:null},x=function(e){if(!o||!e)return!1;if(o.elem.contains(e))return!0;const t=b();return!(!t||!t.containsElement(e))},y=function(){let e=o;for(;e.parentMenu;)e=e.parentMenu;return e},w=function(e){const t=o.items[e];return!(!t||"item"!=t.type||1!=t.enabled)},C=function(e){if(l==e)return;e>=0&&e!=d&&o.closeSubmenu();const t=r[l],n=l==d&&b();t&&t.label&&!n&&v(t,0),l=e;const i=r[l];i&&i.label&&v(i,1)},v=function(e,t){const n=t?i.itemHover:i.item,o=1==e.item.enabled?n.textColor:i.disabled.textColor;e.color=n.color,i.item.border&&(e.borderColor=t&&i.itemHover.borderColor?i.itemHover.borderColor:i.item.borderColor),e.label.textColor=o,e.icon&&e.icon.isSvg&&(e.icon.textColor=o),e.arrow&&(e.arrow.textColor=o),e.lblShortcut&&(e.lblShortcut.textColor=o)},k=function(e){const t=1==e.item.enabled;if(e.cursor=t?"pointer":"default",e.aria={disabled:t?"false":"true"},e.icon){const n=e.icon.isSvg?i.icon.opacity:1,o=e.item.iconFile||e.item.icon;e.icon.opacity=t||!o?n:i.disabled.opacity}p(e.item)&&(e.aria={haspopup:"menu"}),v(e,0)},M=function(e){const t=o.items.length;if(0==t)return;let n=l<0&&e<0?t:l;for(let o=0;o<t;o++)if(n=(n+e+t)%t,w(n))return void C(n)},S=function(e){const t=basic.isOn(e.item.checked);e.icon.text=t?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3.5 8.5l3 3 6-7"/></svg>':"",e.aria={checked:t?"true":"false"}},I=function(){A(),r.forEach(function(e){e.remove()}),r=[],l=-1;const e=o.items.some(function(e){return"item"==e.type&&(e.iconFile||e.icon||g(e))});o.items.forEach(function(t,n){createIn(o.content,function(){r.push("separator"==t.type?function(){const e=Box({width:"auto",height:1,color:i.separator.color,shrink:0});return e.css.margin=i.separator.space+"px "+i.item.padding+"px",e.role="separator",e}():function(e,t,n){const r=HGroup({width:"auto",height:i.item.height,align:"left center",gap:i.item.gap,padding:[i.item.padding,0],round:i.item.round});return i.item.border&&r.props({border:i.item.border,borderColor:i.item.borderColor}),r.role="menuitem",r.item=e,n&&(g(e)?(r.icon=Label({width:i.icon.width,height:i.icon.height,shrink:0}),r.icon.elem.classList.add("context-menu-svg"),r.icon.isSvg=1,r.role="menuitemcheckbox",S(r)):e.icon?(r.icon=Label({width:i.icon.width,height:i.icon.height,shrink:0}),r.icon.text=e.icon,r.icon.elem.classList.add("context-menu-svg"),r.icon.isSvg=1):e.iconFile?(r.icon=Icon({width:i.icon.width,height:i.icon.height,shrink:0}),r.icon.load(e.iconFile),r.icon.elem.alt=""):r.icon=Box({width:i.icon.width,height:i.icon.height,color:"transparent",shrink:0})),r.label=Label({plainText:e.text,fontSize:i.item.fontSize,ellipsis:1,shrink:1}),r.label.css.minWidth="0",r.label.grow=1,e.shortcut&&(r.lblShortcut=Label({plainText:e.shortcut,fontSize:i.shortcut.fontSize,opacity:i.shortcut.opacity,shrink:0,css:{marginLeft:i.shortcut.space-i.item.gap+"px",whiteSpace:"nowrap"}})),p(e)&&(r.arrow=Label({width:14,height:i.icon.height,shrink:0,opacity:i.submenu.arrowOpacity}),r.arrow.text='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 4l4 4-4 4"/></svg>',r.arrow.elem.classList.add("context-menu-svg")),endGroup(),k(r),r.on("mouseenter",function(){C(1==e.enabled?t:-1),1==e.enabled&&p(e)&&B(t,0)}),r.on("click",function(){p(e)?1==e.enabled&&B(t,0):o.clickItem(t)}),r}(t,n,e))})})},A=function(){d=-1,r.forEach(function(e){e.submenu&&e.submenu.remove(),e.submenu=null})},B=function(e,t){const n=r[e],a=o.items[e];n&&p(a)&&(d==e&&b()||(o.closeSubmenu(),n.submenu||(n.submenu=ContextMenu({items:a.items,styleName:o.styleName,style:i,minWidth:o.minWidth,maxWidth:o.maxWidth,ariaLabel:a.text,parentMenu:o,onClick:function(e,t,n){o.onClick(e,t,n)}})),d=e,v(n,1),n.submenu.openBeside(n.elem.getBoundingClientRect())),t&&n.submenu.activateFirst())},L=function(e){if(!x(e.target)){if(0===e.button&&o.source&&o.source.elem.contains(e.target)){const e=a.find(function(e){return e.obj==o.source});e&&"click"==e.trigger&&(s=o.source,u=Date.now())}o.close()}},O=function(e){const t=b();if(t&&t.hasActive())return void t.handleKey(e);const n=o.items[l],i="ArrowRight"===e.key||"Enter"===e.key||" "===e.key;if("Escape"===e.key||"ArrowLeft"===e.key&&o.parentMenu)e.preventDefault(),"Escape"===e.key&&e.stopPropagation(),o.parentMenu?o.parentMenu.closeSubmenu():o.close();else if(i&&p(n)&&1==n.enabled)e.preventDefault(),B(l,1);else if("ArrowDown"===e.key)e.preventDefault(),M(1);else if("ArrowUp"===e.key)e.preventDefault(),M(-1);else if("Enter"===e.key||" "===e.key){if(l<0)return;e.preventDefault(),o.clickItem(l)}else if("Tab"===e.key)y().close();else if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const t=y();t.onSideKey(t,"ArrowRight"===e.key?1:-1)}},D=function(e){x(e.target)||o.close()},E=function(){o.close()},W=function(){c&&page.width+"x"+page.height!=m&&o.close()},z=function(e){const t=e?"addEventListener":"removeEventListener";document[t]("pointerdown",L,!0),document[t]("keydown",O,!0),document[t]("wheel",D,!0),window[t]("blur",E),e?page.onResize(W):page.remove_onResize(W)};o.setItems=function(e){o.items=(e||[]).map(f),I(),c&&o.close()},o.getItems=function(){return o.items.slice()},o.getItemByKey=function(e){return o.items.find(function(t){return t.key==e})||null},o.setItemEnabled=function(e,t){const n=o.getItemByKey(e);if(!n)return;n.enabled=h(t);const i=o.items.indexOf(n);1!=n.enabled&&l==i&&C(-1),k(r[i]),l==i&&v(r[i],1)},o.setItemChecked=function(e,t){const n=o.getItemByKey(e);n&&g(n)&&(n.checked=h(t),S(r[o.items.indexOf(n)]))};const H=function(e){c=1,m=page.width+"x"+page.height,o.zIndex=basic.zIndexAbove(o.parentMenu||o.source,t.zIndex),o.setMotion("none"),o.opacity=0,o.css.transform="scale(0.97)",o.visible=1,e(),requestAnimationFrame(function(){o&&c&&(o.setMotion("opacity 0.12s, transform 0.12s"),o.opacity=1,o.css.transform="scale(1)")}),o.parentMenu||(o.elem.focus({preventScroll:!0}),z(1)),o.onOpen(o)};o.openAt=function(e,t,n=null){1==o.enabled&&0!=o.items.length&&(c&&o.close(),o.source=n,H(function(){!function(e,t){const n=o.elem.offsetWidth,i=o.elem.offsetHeight;let r=e,a=t,c="left",l="top";r+n>page.width-8&&(r=e-n,c="right"),a+i>page.height-8&&(a=t-i,l="bottom"),r=Math.max(8,Math.min(r,page.width-n-8)),a=Math.max(8,Math.min(a,page.height-i-8)),o.left=r,o.top=a,o.css.transformOrigin=c+" "+l}(withPageZoom(e),withPageZoom(t))}))},o.openWithEvent=function(e,t=null){o.openAt(e.clientX,e.clientY,t)},o.openBelow=function(e){1==o.enabled&&0!=o.items.length&&(c&&o.close(),o.source=e,H(function(){!function(e){const t=o.elem.offsetWidth,n=o.elem.offsetHeight,i=withPageZoom(e.left),r=withPageZoom(e.bottom),a=withPageZoom(e.top),c=!(r+n<=page.height-8)&&a-n>=8;o.left=Math.max(8,Math.min(i,page.width-t-8)),o.top=c?a-n:Math.max(8,Math.min(r,page.height-n-8)),o.css.transformOrigin="left "+(c?"bottom":"top")}(e.elem.getBoundingClientRect())}))},o.close=function(){c&&(c=0,o.closeSubmenu(),o.parentMenu||z(0),C(-1),o.setMotion("none"),o.visible=0,o.onClose(o))},o.isOpen=function(){return c},o.clickItem=function(e){if(!w(e))return;const t=o.items[e];p(t)?B(e,1):(y().close(),"function"==typeof t.onClick&&t.onClick(o,t,e),o.onClick(o,t,e))},o.attachTo=function(e,t){t=t||o.trigger;const n=e.on(t,function(t,n){n.preventDefault();const i=s==e&&Date.now()-u<1e3;s=null,i||1==o.enabled&&o.openWithEvent(n,e)});return a.push({obj:e,trigger:t,removeEvent:n}),function(){o.detach(e)}},o.detach=function(e){a=a.filter(function(t){return t.obj!=e||("function"==typeof t.removeEvent&&t.removeEvent(),!1)})},o.setEnabled=function(e){o.enabled=h(e),1!=o.enabled&&o.close()},o.refresh=I,o.closeSubmenu=function(){const e=b(),t=r[d],n=d;d=-1,e&&e.close(),t&&t.label&&l!=n&&v(t,0)},o.openBeside=function(e){0!=o.items.length&&(c&&o.close(),o.source=o.parentMenu?o.parentMenu.source:null,H(function(){!function(e){const t=o.elem.offsetWidth,n=o.elem.offsetHeight,r=i.submenu.overlap,a=i.menu.padding+i.menu.border;let c=withPageZoom(e.right)-r,l="left";c+t>page.width-8&&(c=withPageZoom(e.left)-t+r,l="right");const s=withPageZoom(e.top)-a;o.left=Math.max(8,Math.min(c,page.width-t-8)),o.top=Math.max(8,Math.min(s,page.height-n-8)),o.css.transformOrigin=l+" top"}(e)}))},o.containsElement=x,o.handleKey=O,o.hasActive=function(){return l>=0?1:0},o.activateFirst=function(){C(-1),M(1)};const R=o.remove;if(o.superRemove=R,o.remove=function(){o&&(o.close(),a.slice().forEach(function(e){o.detach(e.obj)}),A(),R.call(o),o=null)},basic.addCss("context-menu-svg",".context-menu-svg { display: flex; align-items: center; justify-content: center; } .context-menu-svg svg { display: block; width: 100%; height: 100%; }"),o.css={position:"fixed",boxSizing:"border-box",minWidth:o.minWidth+"px",outline:"none",userSelect:"none"},o.maxWidth>0&&(o.css.maxWidth=o.maxWidth+"px"),o.tabIndex=-1,o.role="menu",o.aria={label:o.ariaLabel},o.content=VGroup({width:"auto",height:"auto",align:"left top",gap:0,position:"relative"}),o.content.css.alignItems="stretch",endGroup(),o.on("mousedown",function(e,t){t.preventDefault()}),o.on("contextmenu",function(e,t){t.preventDefault()}),o.on("mouseleave",function(){C(-1)}),o.setEnabled(o.enabled),o.setItems(e.items),o.visible=0,o.target){(Array.isArray(o.target)?o.target:[o.target]).forEach(function(e){o.attachTo(e,o.trigger)}),Array.isArray(o.target)||o.target.own(o)}return endObject(o),setDefaultContainerBox(n),o};ContextMenu.escapeHtml=basic.escapeHtml,ContextMenu.styles={light:ContextMenuDefaults.style,dark:{menu:{color:"#232322",borderColor:"rgba(255, 255, 255, 0.12)",shadow:"0px 8px 24px rgba(0, 0, 0, 0.5)"},item:{textColor:"rgba(255, 255, 255, 0.85)"},itemHover:{textColor:"rgba(255, 255, 255, 0.95)",color:"rgba(255, 255, 255, 0.08)"},disabled:{textColor:"rgba(255, 255, 255, 0.35)"},separator:{color:"rgba(255, 255, 255, 0.10)"}}},ContextMenu.styles.classic=ContextMenu.styles.light,ContextMenu.createMinimalStyle=function(e){return{menu:{color:e.ground,border:1,borderColor:e.line,round:4,padding:4,shadow:"none"},item:{height:28,fontSize:13,textColor:e.text,color:"transparent",round:3,padding:8,gap:8,border:1,borderColor:"transparent"},itemHover:{textColor:e.text,color:"transparent",borderColor:e.lineHover},disabled:{textColor:e.faintText,opacity:.4},icon:{width:14,height:14,opacity:.85},shortcut:{fontSize:12,opacity:.5,space:20},separator:{color:e.line,space:4}}},ContextMenu.MINIMAL_COLORS={ground:"#FFFFFF",text:Black(.85),faintText:Black(.54),line:Black(.2),lineHover:Black(.45)},ContextMenu.styles.minimal=ContextMenu.createMinimalStyle(ContextMenu.MINIMAL_COLORS),ContextMenu.MINIMAL_DARK_COLORS={ground:"#1A1A19",text:White(.88),faintText:White(.48),line:White(.18),lineHover:White(.42)},ContextMenu.styles.minimalDark=ContextMenu.createMinimalStyle(ContextMenu.MINIMAL_DARK_COLORS);
|
|
16
|
+
;
|
|
17
|
+
/* Bismillah */
|
|
18
|
+
"use strict";const SmartTableDefaults={key:"0",titleHeight:50,itemHeight:40,infoHeight:50,itemLineCount:16,highlightTitle:!0,highlightLine:!0,invertColor:0,noDataFoundAlert:"No data found!",searchKeyword:"",searchTitleIndex:-1,showSearchTitleSelect:1,wheelScroll:0,allowHtml:0,showCellTooltip:1,allTitlesText:"ALL",canSelect:1,fitLineCount:0,locale:"",sortByTitleIndex:0,sortDirection:"A-Z",fillTestData:0,onSelect:function(t,e){},createCellView:null,updateCellView:null,titleDataList:[{name:"ID",dataTitle:"id",dataType:"integer",width:100,sortable:1},{name:"NAME",dataTitle:"name",dataType:"string",width:100,sortable:1},{name:"EMAIL",dataTitle:"email",dataType:"string",width:290,sortable:0},{name:"",dataTitle:"active",dataType:"boolean",width:40,sortable:0}],itemDataList:[{id:1,name:"Bugra",desc:"about",email:"emainil",active:1},{id:2,name:"Alper",desc:"about",email:"emainil",active:1},{id:3,name:"Murat",desc:"about",email:"emainil-3",active:1},{id:4,name:"Deniz",desc:"about",email:"emainil",active:1},{id:5,name:"Nilüfer",desc:"about",email:"emainil-7",active:1},{id:6,name:"Frank",desc:"about",email:"emainil",active:1},{id:7,name:"Dany",desc:"about",email:"emainil-45",active:1},{id:8,name:"Duygu",desc:"about",email:"emainil",active:1},{id:9,name:"Filiz",desc:"about",email:"emainil-356",active:1},{id:10,name:"Anka",desc:"about",email:"emainil",active:1}],scrollBarParams:{bar_border:0,bar_round:3,bar_borderColor:"rgba(0, 0, 0, 1)",bar_width:4,bar_mouseOverWidth:4,bar_mouseOverColor:"#373836",bar_opacity:.4,bar_mouseOverOpacity:.9,bar_padding:2,bar_color:"#373836",neverHide:0,showDots:0},searchTitleMenuParams:{},searchInputParams:{styleName:"ozden",width:"50%",height:36,fontSize:15,searchIconSize:16,searchIconOpacity:.5,placeholder:"Filter",searchIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" preserveAspectRatio="none" fill="#000000"><rect x="0" y="85" width="512" height="57"/><rect x="85" y="227" width="342" height="56"/><rect x="199" y="370" width="114" height="57"/></svg>'),clearIconMinTextWidth:80,clearOnEscape:1},styleName:"light",style:{width:"auto",height:"auto",round:6,line1Color:"white",line2Color:"#F7F7F7",highlightItemCellColor:"#FFFAEB",selectedItemCellColor:"#FFF4D3",selectedBar:{width:0,color:"rgba(95, 158, 160, 0.9)"},focusRingColor:"rgba(95, 158, 160, 0.6)",highlightTitleCellColor:"white",titleUppercase:1,verticalScrollWidth:20,verticalScrollMargin:2,btnScrollDownIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 200" preserveAspectRatio="none" fill="none" stroke="#141414" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 84V116M27 103L40 116L53 103"/></svg>'),btnScrollUpIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 200" preserveAspectRatio="none" fill="none" stroke="#141414" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 116V84M27 97L40 84L53 97"/></svg>'),btnScrollCenterIconFile:"data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 50" fill="none" stroke="#000000" stroke-opacity="0.4" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17.5v15M6.5 21 10 17.5 13.5 21M6.5 29 10 32.5 13.5 29"/></svg>'),sortIconFile:"data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.71,9.88l-4.3-4.29a2,2,0,0,0-2.82,0L6.29,9.88a1,1,0,0,0,0,1.41,1,1,0,0,0,1.42,0L11,8V19a1,1,0,0,0,2,0V8l3.29,3.29a1,1,0,1,0,1.42-1.41Z"/></svg>'),loadingIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" preserveAspectRatio="none"><circle cx="256" cy="256" r="206" fill="#FFFFFF" stroke="#141414" stroke-width="20"/><path d="M256 113V256H358" fill="none" stroke="#141414" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/></svg>'),searchTitleCheckIconFile:"data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#373836" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),invertIconColor:0,sortIcon:{size:16,opacity:.25,activeOpacity:1},cellTooltip:{fontSize:14,color:"white",textColor:Black(.8),round:6,border:1,borderColor:Black(.15),shadow:"0 6px 16px "+Black(.12),arrow:10,padding:[12,8],maxWidth:360},box:{color:"white"},boxBorder:{border:1,borderColor:Black(.15)},boxTitleLine:{color:"whitesmoke"},boxTitleCell:{padding:[10,0],borderRight:"1px solid "+Black(.08),borderBottom:"1px solid "+Black(.2)},lblTitleCell:{fontSize:15,fontFamily:"opensans-bold",textColor:Black(.8)},boxItemCell:{borderBottom:"1px solid "+Black(.08),borderRight:"none",padding:[10,0]},lblItemCell:{fontSize:15,textColor:Black(.7),fontFamily:"opensans"},boxInfoLine:{color:"white",borderTop:"1px solid "+Black(.2)},lblBoxInfoLine:{fontSize:14,textColor:Black(.5)},lblNoDataFound:{color:"transparent",textColor:Black(.45),padding:[8,2],fontSize:15,round:8,border:0,borderColor:"transparent"},lblSearchTitle:{color:"white",textColor:Black(.6),padding:[8,2],fontSize:12,round:50,border:1,borderColor:Black(.12)},btnScrollCenter:{color:"white",round:100,border:1,borderColor:Black(.2)},btnScrollUp:{color:"whitesmoke",round:100,border:1,borderColor:Black(.15)},btnScrollDown:{color:"whitesmoke",round:100,border:1,borderColor:Black(.15)},boxSort:{color:"transparent"}}},SmartTable=function(t={}){basic.applyStylePackage(t,SmartTable.styles,SmartTableDefaults),mergeIntoIfMissing(t,SmartTableDefaults);let e=startObject(t);e.titleDataList=e.titleDataList.map(t=>({...t})),e.itemDataList=[...e.itemDataList];const o=100,l="tr-TR",r=e.itemHeight;let i=0,n=null,a=null,c=null;const s=function(t,o){const l=null==o?"":String(o);1==e.allowHtml?t.text=l:t.plainText=l},d=function(){return Math.max(0,e.visibleItemDataList.length-e.itemLineCount)},h=function(t){return t<0?0:Math.min(t,d())},u=function(t){return"number"==typeof t?t:"string"==typeof t&&""!==t.trim()?Number(t):NaN};e.state="normal",e.visibleItemDataList=[...e.itemDataList],e.searchInput=null,e.selectedItemData=null,e.titleCellList=[],e.titleCellCount=0,e.itemLineList=[],e.startedItemIndexForScrolling=0,e.scrollVars={},e.recalcItemHeight=0,e.resizeTimer=null,e.refreshTimer=null,e.filterTimer=null,e.setState=function(t){e.state=t};const m=function(){};e.refresh=function(t=3){e.refreshTimer=waitAndRun(e.refreshTimer,m,t)};const g=e.remove;e.superRemove=g,e.remove=function(){e&&(clearTimeout(e.resizeTimer),clearTimeout(e.refreshTimer),clearTimeout(e.filterTimer),e.searchTitleMenu&&e.searchTitleMenu.remove(),D(),g.call(e),e=null)};const b=function(t){t.opacity=0,t.clickable=0,t.cursor="",t.itemData=null,S(t)},f=function(t,o){t.opacity=1,t.clickable=1,t.cursor="pointer",t.itemData=o,S(t);for(let l=0;l<e.titleCellCount;l++){const r=e.titleDataList[l],i=t["itemCell"+l],n=o[r.dataTitle]??"";"lastValue"in i&&i.lastValue===n||(i.lastValue=n,s(i.label,n)),e.updateCellView&&e.updateCellView(i,l,n,e)}};e.refreshData=function(){const t=e.startedItemIndexForScrolling,o=e.visibleItemDataList,l=e.itemLineCount;for(let r=0;r<l;r++){const l=e.itemLineList[r],i=o[t+r];i?f(l,i):b(l)}e.setVerticalScrollEnabled(o.length>l),e.updateInfoLabel(),k()};const p=function(t,e,o){t.opacity=e,t.clickable=o};e.setVerticalScrollEnabled=function(t){if(t&&e.visibleItemDataList.length>e.itemLineCount)return p(e.btnScrollCenter,1,1),p(e.btnScrollUp,1,1),void p(e.btnScrollDown,1,1);p(e.btnScrollCenter,0,0),p(e.btnScrollUp,.5,0),p(e.btnScrollDown,.5,0)},e.setTitleCellWidth=function(t,o){t<0||t>=e.titleCellCount||(e.titleCellList[t].width=o,e.titleDataList[t].width=o,e.itemLineList.forEach(function(e){e["itemCell"+t].width=o}))},e.createTitleLine=function(){e.titleCellList=[],e.boxTitleLine.html="",e.titleDataList.forEach(function(t,o){const l=e.createTitleCell(t,o);e.titleCellList.push(l),e.boxTitleLine.add(l)}),e.titleCellCount=e.titleCellList.length},e.setTitleDataList=function(t){e.titleDataList=t.map(t=>({...t})),e.createTitleLine(),e.createItemLines(),e.recalcItemHeight&&e.setItemHeight(e.itemHeight),e.stretchLastCell(e.calcLastCellWidth()),e.titleDataList[e.sortByTitleIndex]||(e.sortByTitleIndex=0),e.updateSortIcon(),e.updateSearchTitleSelect(),e.filterAndSortData()},e.createSortIcon=function(t){const o=e.style.sortIcon.size;startBox({align:"right center",color:e.style.boxSort.color,round:100,border:0,borderColor:"rgba(0,0,0,0.1)",width:o,height:o,right:2,padding:[4,0],position:"absolute"}),0==t.sortable&&(that.opacity=0),t.add(that),that.center("top"),t.icon=Icon({width:o,height:o,left:0,top:0,opacity:e.style.sortIcon.opacity}),that.setMotion("opacity 0.3s, transform 0.3s"),that.load(e.style.sortIconFile),1==e.style.invertIconColor&&(that.css.filter="invert(100%)"),that.center(),endBox()},e.resetSortIcons=function(t){e.titleCellList.forEach(function(o,l){l!=t.titleCellIndex&&(o.icon.rotate=0,o.icon.opacity=e.style.sortIcon.opacity,o.sortDirection="")})},e.createTitleCell=function(t,l){const r=AutoLayout({flow:"horizontal",align:"center left",width:t.width||o,padding:e.style.boxTitleCell.padding,height:e.titleHeight,color:"transparent",border:0,position:"relative"});return that.css={borderRight:e.style.boxTitleCell.borderRight,borderBottom:e.style.boxTitleCell.borderBottom},that.cursor="pointer",that.titleCellIndex=l,that.titleDataTitle=t.dataTitle,that.sortable=t.sortable,r.label=Label({...e.style.lblTitleCell}),s(r.label,t.name),that.css.fontFamily=e.style.lblTitleCell.fontFamily,1==e.style.titleUppercase&&(that.css.textTransform="uppercase"),endAutoLayout(),e.createSortIcon(r),r.on("click",function(t,o){1==t.sortable&&(e.resetSortIcons(t),e.sortByTitleIndex=t.titleCellIndex,e.sortDirection="A-Z"!=t.sortDirection?"A-Z":"Z-A",e.updateSortIcon(),e.filterAndSortData())}),r.on("mouseover",function(t,o){e.applyColumnHighlight(t)}),r.on("mouseout",function(t,o){e.clearColumnHighlight(t)}),r},e.updateSortIcon=function(){const t=e.titleCellList[e.sortByTitleIndex];t&&("A-Z"==e.sortDirection?(t.sortDirection="A-Z",t.icon.rotate=0):(t.sortDirection="Z-A",t.icon.rotate=180),t.icon.opacity=e.style.sortIcon.activeOpacity)};const C=function(t,o,l){t.color=o,e.itemLineList.forEach(function(e){e["itemCell"+t.titleCellIndex].color=l})};e.clearColumnHighlight=function(t){e.highlightTitle&&(C(t,"transparent","transparent"),e.itemLineList.forEach(S))},e.applyColumnHighlight=function(t){e.highlightTitle&&C(t,e.style.highlightTitleCellColor,e.style.highlightItemCellColor)},e.createItemLines=function(){T(null),e.itemLineList.forEach(function(t){t.remove()}),e.itemLineList=[];for(let t=0;t<e.itemLineCount;t++){const o=t,l=e.createItemLine(e.itemDataList[t],o);e.itemLineList.push(l),e.boxItemLineGroup.add(l)}},e.createItemLine=function(t,o){const l=HGroup({height:e.itemHeight||100,width:"auto",align:"top left",padding:[0,0],gap:0,color:o%2?e.style.line2Color:e.style.line1Color,position:"relative"});return e.titleDataList.forEach(function(t,o){l["itemCell"+o]=e.createItemCell(t.width,o,l)}),endGroup(),l.on("click",function(t){t.itemData&&(1==e.canSelect&&(e.selectItem(t.itemData),e.elem.focus({preventScroll:!0})),e.onSelect(e,t.itemData))}),"auto"!=e.style.height&&(l.visible=0),l};const S=function(t){const o=Boolean(t.itemData)&&t.itemData===e.selectedItemData;let l="transparent";t.isHover&&e.highlightLine&&(l=e.style.highlightItemCellColor),o&&(l=I()),function(t,o){for(let l=0;l<e.titleCellCount;l++)t["itemCell"+l].color=o}(t,l);const r=t.itemCell0;r&&(r.boxShadow=o?x():"none")},x=function(){if(!e.style.selectedBar.width)return"none";return"inset "+((basic.num(e.style.boxBorder.border)||0)+e.style.selectedBar.width)+"px 0 0 "+e.style.selectedBar.color},I=function(){return e.style.selectedItemCellColor||e.style.highlightItemCellColor},T=function(t){n=t,w()},w=function(){D(),n&&1==e.showCellTooltip&&(c=e.after(300,L))},L=function(){c=null;const t=y(n);"undefined"!=typeof Tooltip?t&&(a=Tooltip.show(n,t,e.style.cellTooltip,"top",function(e){v(t,e.look)}),a.cellText=t):n.elem.title=t},y=function(t){if(!t.itemLine.itemData)return"";const e=t.label.elem;return e.scrollWidth<=e.clientWidth?"":e.textContent},v=function(t,e){Label({plainText:t,fontSize:e.fontSize,textColor:e.textColor,css:{whiteSpace:"normal",overflowWrap:"anywhere",width:"max-content",maxWidth:e.maxWidth+"px"}})},D=function(){c&&c(),c=null,a&&a.remove(),a=null},k=function(){n&&(a&&a.cellText===n.label.elem.textContent||w())};e.setShowCellTooltip=function(t){e.showCellTooltip=basic.isOn(t)?1:0,w()},e.createItemCell=function(t,l,r){let i=AutoLayout({align:"center left",width:t||o,padding:e.style.boxItemCell.padding,height:"100%",color:"transparent",border:0});return that.css={borderBottom:e.style.boxItemCell.borderBottom,borderRight:e.style.boxItemCell.borderRight},i.label=Label({text:"",...e.style.lblItemCell}),that.css={whiteSpace:"nowrap",textOverflow:"ellipsis",fontFamily:e.style.lblItemCell.fontFamily},endAutoLayout(),i.on("mouseover",function(t,e){r.isHover=1,S(r)}),i.on("mouseout",function(t,e){r.isHover=0,S(r)}),i.itemLine=r,i.onHoverChange(function(t,e){!function(t,e){e?T(t):n===t&&T(null)}(i,e)}),e.createCellView&&createIn(i,function(){e.createCellView(i,l,e)}),i},e.initScrollMetrics=function(){e.scrollVars.minY=e.titleHeight,e.scrollVars.scrollAreaHeight=e.height-e.titleHeight-e.infoHeight,e.scrollVars.scrollIconHeight=e.btnScrollCenter.height,e.scrollVars.maxY=e.scrollVars.minY+e.scrollVars.scrollAreaHeight-e.scrollVars.scrollIconHeight,e.scrollVars.totalPath=e.scrollVars.maxY-e.scrollVars.minY,e.scrollVars.isDragging=!1,e.scrollVars.startY=0,e.scrollVars.startTop=0},e.syncScrollPosition=function(){const t=d();if(0===t)return;const o=e.startedItemIndexForScrolling/t;e.btnScrollCenter.top=e.scrollVars.minY+o*e.scrollVars.totalPath},e.createScrollEvents=function(){e.btnScrollCenter.clickable=1,e.btnScrollCenter.elem.setAttribute("draggable","false"),e.btnScrollCenter.cursor="grab",e.initScrollMetrics(),e.on("wheel",function(t,o){if(1!=e.wheelScroll)return;if(Math.abs(o.deltaX)>Math.abs(o.deltaY))return;o.preventDefault();const l=o.deltaY>0?1:-1,r=h(e.startedItemIndexForScrolling+l);r!==e.startedItemIndexForScrolling&&(e.startedItemIndexForScrolling=r,e.syncScrollPosition(),e.refreshData())},{passive:!1}),e.btnScrollCenter.on("mousedown",function(t,o){e.scrollVars.isDragging=!0,e.scrollVars.startY=o.clientY,e.scrollVars.startTop=e.btnScrollCenter.top,e.btnScrollCenter.cursor="grabbing",document.body.style.userSelect="none"}),e.listenTo(window,"mousemove",function(t,e){B(e)}),e.listenTo(window,"mouseup",function(){F()})};const B=function(t){if(!e||!e.scrollVars.isDragging)return;const o=t.clientY-e.scrollVars.startY;let l=e.scrollVars.startTop+o;if(l<e.scrollVars.minY&&(l=e.scrollVars.minY),l>e.scrollVars.maxY&&(l=e.scrollVars.maxY),e.btnScrollCenter.top=l,e.scrollVars.totalPath<=0)return;const r=(l-e.scrollVars.minY)/e.scrollVars.totalPath,i=Math.round(r*d());i!==e.startedItemIndexForScrolling&&(e.startedItemIndexForScrolling=i,e.refreshData())},F=function(){e&&e.scrollVars.isDragging&&(e.scrollVars.isDragging=!1,e.btnScrollCenter.cursor="grab",document.body.style.userSelect="auto")};e.getSelectedIndex=function(){return e.selectedItemData?e.visibleItemDataList.indexOf(e.selectedItemData):-1},e.selectItem=function(t){1==e.canSelect&&(e.selectedItemData=t||null,A(),e.refreshData())},e.clearSelection=function(){e.selectItem(null)},e.setCanSelect=function(t){e.canSelect=basic.isOn(t)?1:0,1!=e.canSelect&&(e.selectedItemData=null),M(),e.refreshData()};const M=function(){e.tabIndex=1==e.canSelect?0:null,1!=e.canSelect&&e.elem.blur()},R=function(){const t=e.elem.matches(":focus-visible");e.boxBorder.css.outline=t?"2px solid "+e.style.focusRingColor:"none",e.boxBorder.css.outlineOffset="-2px"},A=function(){const t=e.getSelectedIndex();if(-1==t)return;let o=e.startedItemIndexForScrolling;t<o&&(o=t),t>=o+e.itemLineCount&&(o=t-e.itemLineCount+1),e.startedItemIndexForScrolling=h(o),e.syncScrollPosition()};e.scrollPage=function(t){const o=h(e.startedItemIndexForScrolling+t*e.itemLineCount);o!==e.startedItemIndexForScrolling&&(e.startedItemIndexForScrolling=o,e.refreshData(),e.syncScrollPosition())},e.updateInfoLabel=function(){const t=e.visibleItemDataList.length;if(0==t)return e.boxInfoLine.label.text="0 - 0 / 0",void(e.lblNoDataFound.opacity=1);e.lblNoDataFound.opacity=0;const o=e.startedItemIndexForScrolling+1;let l=e.startedItemIndexForScrolling+e.itemLineCount;l>t&&(l=t),e.boxInfoLine.label.text=`${V(o)} - ${V(l)} / ${V(t)}`};const V=function(t){try{return t.toLocaleString(e.locale||document.documentElement.lang||l)}catch(e){return t.toLocaleString(l)}};e.setLocale=function(t){e.locale=t,e.updateInfoLabel()},e.setScrollToTop=function(){e.startedItemIndexForScrolling=0,e.btnScrollCenter.top=e.scrollVars.minY},e.setItemDataList=function(t){e.itemDataList=[...t],e.filterAndSortData()};const H=function(t,o){if(""===o)return t;const l=e.titleDataList[e.searchTitleIndex],r=l?[l]:e.titleDataList;return t.filter(t=>r.some(e=>function(t,e){return null!=t&&SmartTable.toSearchText(t).includes(e)}(t[e.dataTitle],o)))},z=function(t,o,l){const r=e.titleDataList[o];if(!r||0===r.sortable)return;const i=r.dataTitle;t.sort((t,e)=>{const o=function(t,e){const o=u(t),l=u(e);return Number.isFinite(o)&&Number.isFinite(l)?o-l:String(t).localeCompare(String(e),"tr")}(t[i]??"",e[i]??"");return"A-Z"===l?o:-o})};e.filterAndSortData=function(){e.itemDataList.length>1e3&&e.showLoading(1),e.filterTimer=waitAndRun(e.filterTimer,function(){e.filterTimer=null;const t=SmartTable.toSearchText(e.searchKeyword??"").trim(),o=H([...e.itemDataList],t);z(o,e.sortByTitleIndex,e.sortDirection),e.visibleItemDataList=o,e.setScrollToTop(),-1==e.getSelectedIndex()&&(e.selectedItemData=null),A(),e.refreshData(),e.showLoading(0)},50)},e.generateTestData=function(){let t=[];for(let o=0;o<1e5;o++){const o=e.itemDataList.map(e=>({...e,id:t.length+e.id}));t.push(...o)}e.itemDataList=t,e.visibleItemDataList=t,console.log("Yeni veri sayısı:",e.visibleItemDataList.length)},e.createVerticalScroll=function(){const t=e.style.verticalScrollWidth,o=-1*(t+e.style.verticalScrollMargin);e.btnScrollCenter=startBox(0,0,t,50,{right:o,top:e.titleHeight,opacity:0,clickable:0,...e.style.btnScrollCenter}),Icon(0,0,"100%","100%"),that.load(e.style.btnScrollCenterIconFile),endBox(),e.btnScrollUp=Box(0,0,t,e.titleHeight,{right:o,...e.style.btnScrollUp}),that.cursor="pointer",that.on("click",function(t,o){e.scrollPage(-1)}),Icon(0,0,"100%","100%"),e.btnScrollUp.add(that),that.load(e.style.btnScrollUpIconFile),1==e.style.invertIconColor&&(that.css.filter="invert(100%)"),e.btnScrollDown=Box(0,0,t,e.infoHeight,{right:o,bottom:0,...e.style.btnScrollDown}),that.cursor="pointer",that.on("click",function(t,o){e.scrollPage(1)}),Icon(0,0,"100%","100%"),e.btnScrollDown.add(that),that.load(e.style.btnScrollDownIconFile),1==e.style.invertIconColor&&(that.css.filter="invert(100%)")};const N=function(){const t=e.lblSelectedSortKey.elem.offsetWidth,o=t>0;e.searchInput.setClearIconRight(o?6+t+6:i)};e.createToolbar=function(){HGroup({align:"left center",gap:12,padding:[8,0]}),e.boxInfoLine.add(that),e.searchInput=SearchInput(e.searchInputParams),that.setValue(e.searchKeyword,1),that.onEnter=function(t){e.searchKeyword=t.getSearchText(),e.filterAndSortData()},i=that.clearIconRight,function(){const t=String(e.searchInputParams.width);e.searchInput.css.minWidth="0px",t.endsWith("%")&&(e.searchInput.css.flexGrow="1",e.searchInput.css.maxWidth="max("+t+", 240px)")}(),e.boxInfoLine.label=Label({text:"0 - 0 / 0",...e.style.lblBoxInfoLine}),that.css={marginLeft:"auto",marginRight:"6px",flexShrink:"0"},endGroup(),e.lblSelectedSortKey=createIn(e.searchInput,function(){return Label({right:6,opacity:1,clickable:1,...e.style.lblNoDataFound,...e.style.lblSearchTitle})}),s(e.lblSelectedSortKey,e.allTitlesText),that.cursor="pointer",that.ellipsis=1,that.css.maxWidth="160px",that.css.top="50%",that.css.transform="translateY(-50%)",that.setMotion("opacity 0.2s"),that.onResize(N),"function"==typeof ContextMenu?(e.searchTitleMenu=ContextMenu({minWidth:160,...e.searchTitleMenuParams,onClick:function(t,o){e.setSearchTitleIndex(o.data)}}),e.searchTitleMenu.attachTo(e.lblSelectedSortKey,"click")):e.lblSelectedSortKey.on("click",function(){e.selectNextSearchTitle()})},e.stretchLastCell=function(t){if(!(t>0)||0==e.titleCellCount)return;const o=e.titleCellCount-1;e.itemLineList.forEach(function(e){e["itemCell"+o].width=t}),e.titleCellList[o].width=t},e.calcLastCellWidth=function(){const t=e.titleDataList,l=e.width;if(0==t.length)return 0;let r=0;t.forEach(function(t){r+=basic.num(t.width||o)});const i=basic.num(t[t.length-1].width||o);return l>r?l-r+i:i},e.setItemHeight=function(t){e.itemHeight=t,e.itemLineList.forEach(function(t){t.height=e.itemHeight,t.visible=1})},e.setHeight=function(t){e.recalcItemHeight="auto"!=t?1:0,e.height=t},e.setWidth=function(t){if(!("string"==typeof t&&t.includes("%")))return e.width=t,void(e.css={marginRight:e.getVerticalScrollWidth()+"px"});e.css.marginRight&&(e.css={marginRight:""}),e.width="calc("+t+" - "+e.getVerticalScrollWidth()+"px)"},e.getTotalWidth=function(){return e.width+e.getVerticalScrollWidth()},e.getVerticalScrollWidth=function(){return e.style.verticalScrollWidth+e.style.verticalScrollMargin},e.createLoading=function(){e.boxLoading=VGroup({color:Black(.3),clickable:1,round:e.style.round}),e.add(e.boxLoading),Icon({width:32,height:32}),that.load(e.style.loadingIconFile),endGroup()},e.showLoading=function(t){t?(e.boxLoading.visible=1,e.setVerticalScrollEnabled(!1)):(e.boxLoading.visible=0,e.setVerticalScrollEnabled(!0))},e.createNoDataFoundLabel=function(){HGroup(),e.lblNoDataFound=Label({opacity:0,...e.style.lblNoDataFound}),s(e.lblNoDataFound,e.noDataFoundAlert),that.setMotion("opacity 0.2s"),endGroup()};const E=function(t){return String(t.name??"").replace(/<[^>]*>/g,"").trim()||String(t.dataTitle??"")};e.updateSearchTitleSelect=function(){e.titleDataList[e.searchTitleIndex]||(e.searchTitleIndex=-1);const t=e.titleDataList[e.searchTitleIndex];if(s(e.lblSelectedSortKey,t?E(t):e.allTitlesText),e.lblSelectedSortKey.visible=1==e.showSearchTitleSelect?1:0,!e.searchTitleMenu)return;const o=function(t){return e.searchTitleIndex==t?e.style.searchTitleCheckIconFile:""},l=[{text:e.allTitlesText,data:-1,iconFile:o(-1)},"-"];e.titleDataList.forEach(function(t,e){l.push({text:E(t),data:e,iconFile:o(e)})}),e.searchTitleMenu.setItems(l),1!=e.showSearchTitleSelect&&e.searchTitleMenu.close()},e.setSearchTitleIndex=function(t){e.searchTitleIndex=e.titleDataList[t]?t:-1,e.updateSearchTitleSelect(),""!==String(e.searchKeyword??"").trim()&&e.filterAndSortData()},e.selectNextSearchTitle=function(){const t=e.searchTitleIndex+1;e.setSearchTitleIndex(t<e.titleDataList.length?t:-1)},e.setShowSearchTitleSelect=function(t){e.showSearchTitleSelect=basic.isOn(t)?1:0,e.updateSearchTitleSelect()},e.setWheelScroll=function(t){e.wheelScroll=basic.isOn(t)?1:0};const W=function(){return e.height-e.titleHeight-e.infoHeight},O=function(){if(e.recalcItemHeight&&1==e.fitLineCount)P();else if(e.recalcItemHeight){const t=W()/e.itemLineCount;(e.itemHeight!=t||e.itemLineList[0]&&!e.itemLineList[0].visible)&&e.setItemHeight(t)}e.stretchLastCell(e.calcLastCellWidth()),e.initScrollMetrics(),e.syncScrollPosition(),e.scrollBar.refreshScroll(),e.refreshData()},P=function(){const t=W();if(t<=0)return;const o=Math.max(1,Math.round(t/r));o==e.itemLineList.length?e.setItemHeight(t/o):e.setItemLineCount(o)};return e.setItemLineCount=function(t){e.itemLineCount=Math.max(1,Math.round(t)),e.createItemLines();const o=W(),l=e.recalcItemHeight&&o>0;e.setItemHeight(l?o/e.itemLineCount:e.itemHeight),e.stretchLastCell(e.calcLastCellWidth()),e.startedItemIndexForScrolling=h(e.startedItemIndexForScrolling),A(),e.initScrollMetrics(),e.syncScrollPosition(),e.refreshData()},e.setFitLineCount=function(t){e.fitLineCount=basic.isOn(t)?1:0,O()},e.createResizeEvent=function(){e.onResize(function(t){e.resizeTimer=waitAndRun(e.resizeTimer,O,3)})},e.init=function(){e.clickable=1,e.clipContent=0,e.color=e.style.box.color,e.round=e.style.round,1==e.invertColor&&(e.css.filter="invert(100%)"),e.setWidth(e.style.width),e.setHeight(e.style.height),e.boxHorizontalScrollable=VGroup({align:"top left",width:"auto",height:"auto",padding:[0,0],gap:0,position:"relative",clipContent:0,scrollX:1}),that.css={borderTopLeftRadius:e.style.round+"px",borderTopRightRadius:e.style.round+"px",borderBottomRightRadius:"0px",borderBottomLeftRadius:"0px",marginBottom:e.infoHeight+"px"},e.boxTitleLine=HGroup({height:"auto",width:"auto",align:"top left",padding:[0,0],gap:0,color:e.style.boxTitleLine.color}),endGroup(),e.boxItemLineGroup=VGroup({align:"top left",width:"auto",height:"auto",padding:[0,0],gap:0}),endGroup(),endGroup(),e.boxInfoLine=HGroup({bottom:0,left:0,height:e.infoHeight,width:"100%",align:"top left",padding:[0,0],gap:0,...e.style.boxInfoLine}),endGroup(),that.css={borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomRightRadius:e.style.round+"px",borderBottomLeftRadius:e.style.round+"px",borderTop:e.style.boxInfoLine.borderTop},that.clickable=0,e.createToolbar(),e.createNoDataFoundLabel(),e.boxBorder=Box(0,0,"100%","100%",e.style.boxBorder),that.round=e.style.round,that.color="transparent",e.createVerticalScroll(),e.scrollBar=ScrollBar({scrollableBox:e.boxHorizontalScrollable,...e.scrollBarParams}),e.createResizeEvent(),e.createLoading()},e.init(),e.createTitleLine(),e.createItemLines(),e.createScrollEvents(),e.on("keydown",function(t,o){if(1!=e.canSelect||o.target!=e.elem)return;if(o.metaKey||o.ctrlKey||o.altKey)return;if("Enter"==o.key)return void(e.selectedItemData&&e.onSelect(e,e.selectedItemData));const l=function(t){const o=e.itemLineCount,l=e.visibleItemDataList.length;return{ArrowDown:1,ArrowUp:-1,PageDown:o,PageUp:-o,Home:-l,End:l}[t]||0}(o.key);0!=l&&(o.preventDefault(),function(t){const o=e.visibleItemDataList.length;if(0==o)return;let l=e.getSelectedIndex();-1==l&&(l=t>0?-1:o),e.selectItem(e.visibleItemDataList[basic.clamp(l+t,0,o-1)])}(l),R())}),e.on("focus",R),e.on("blur",R),M(),e.stretchLastCell(e.calcLastCellWidth()),e.updateSortIcon(),e.updateSearchTitleSelect(),e.fillTestData&&e.generateTestData(),e.filterAndSortData(),endObject(e)};SmartTable.toSearchText=function(t){const e=String(t).toLocaleLowerCase("tr");return SmartTable.NOT_ASCII.test(e)?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/ı/g,"i"):e},SmartTable.NOT_ASCII=/[^\u0000-\u007f]/,SmartTable.styles={light:{style:{}},dark:{style:{line1Color:"#232428",line2Color:"#27292D",highlightItemCellColor:"#2E3035",selectedItemCellColor:"#24383A",focusRingColor:"rgba(95, 179, 181, 0.7)",highlightTitleCellColor:"#33353A",btnScrollCenterIconFile:"data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 50" fill="none" stroke="#FFFFFF" stroke-opacity="0.5" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17.5v15M6.5 21 10 17.5 13.5 21M6.5 29 10 32.5 13.5 29"/></svg>'),searchTitleCheckIconFile:"data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#E6E6E6" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),invertIconColor:1,sortIcon:{size:16,opacity:.3,activeOpacity:1},cellTooltip:{color:"#2B2D31",textColor:"rgba(255, 255, 255, 0.88)",borderColor:"rgba(255, 255, 255, 0.14)",shadow:"0 8px 24px rgba(0, 0, 0, 0.5)"},box:{color:"#232428"},boxBorder:{border:1,borderColor:"rgba(255, 255, 255, 0.12)"},boxTitleLine:{color:"#2B2D31"},boxTitleCell:{borderRight:"1px solid rgba(255, 255, 255, 0.08)",borderBottom:"1px solid rgba(255, 255, 255, 0.14)"},lblTitleCell:{textColor:"rgba(255, 255, 255, 0.85)"},boxItemCell:{borderBottom:"1px solid rgba(255, 255, 255, 0.06)"},lblItemCell:{textColor:"rgba(255, 255, 255, 0.75)"},boxInfoLine:{color:"#232428",borderTop:"1px solid rgba(255, 255, 255, 0.14)"},lblBoxInfoLine:{textColor:"rgba(255, 255, 255, 0.5)"},lblNoDataFound:{textColor:"rgba(255, 255, 255, 0.45)"},lblSearchTitle:{color:"#33353A",textColor:"rgba(255, 255, 255, 0.7)",borderColor:"rgba(255, 255, 255, 0.14)"},btnScrollCenter:{color:"#2B2D31",borderColor:"rgba(255, 255, 255, 0.2)"},btnScrollUp:{color:"#2B2D31",borderColor:"rgba(255, 255, 255, 0.14)"},btnScrollDown:{color:"#2B2D31",borderColor:"rgba(255, 255, 255, 0.14)"}},searchInputParams:{styleName:"ozdenDark"},scrollBarParams:{bar_color:"#A0A0A0",bar_mouseOverColor:"#D0D0D0"},searchTitleMenuParams:{styleName:"dark"}},green:{style:{width:"auto",height:"auto",round:6,line1Color:"white",line2Color:"whitesmoke",highlightItemCellColor:"#F3E7C2",selectedItemCellColor:null,selectedBar:{width:3,color:"rgba(95, 158, 160, 0.9)"},focusRingColor:"rgba(95, 158, 160, 0.6)",highlightTitleCellColor:White(.2),titleUppercase:0,verticalScrollWidth:20,verticalScrollMargin:2,btnScrollDownIconFile:SmartTableDefaults.style.btnScrollDownIconFile,btnScrollUpIconFile:SmartTableDefaults.style.btnScrollUpIconFile,btnScrollCenterIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 200" preserveAspectRatio="none" fill="none" stroke="#D96450" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 28V172M27 41L40 28L53 41M27 159L40 172L53 159"/></svg>'),sortIconFile:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" preserveAspectRatio="none" fill="none" stroke="#141414" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 24V56M27 43L40 56L53 43"/></svg>'),loadingIconFile:SmartTableDefaults.style.loadingIconFile,searchTitleCheckIconFile:"data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#373836" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),invertIconColor:0,sortIcon:{size:22,opacity:.5,activeOpacity:1},box:{color:"white"},boxBorder:{border:2,borderColor:Black(.8)},boxTitleLine:{color:"#65A293"},boxTitleCell:{padding:[8,0],borderRight:"1px solid rgba(0, 0, 0, 0.5)",borderBottom:"2px solid #141414"},lblTitleCell:{fontSize:20,fontFamily:"opensans",textColor:Black(.8)},boxItemCell:{borderBottom:"1px solid darkgray",borderRight:"1px solid rgba(0, 0, 0, 0.05)",padding:[8,0]},lblItemCell:{fontSize:20,textColor:Black(.75),fontFamily:"opensans"},boxInfoLine:{color:"#E4E4E4",borderTop:"1px solid rgba(0, 0, 0, 0)"},lblBoxInfoLine:{fontSize:16,textColor:Black(.85)},lblNoDataFound:{color:"lightgray",textColor:Black(.8),padding:[8,2],fontSize:14,round:8,border:1,borderColor:Black(.4)},lblSearchTitle:{color:"whitesmoke",textColor:Black(.8),padding:[8,2],fontSize:14,round:8,border:1,borderColor:Black(.15)},btnScrollCenter:{color:"white",round:100,border:1,borderColor:"rgba(0,0,0,0.4)"},btnScrollUp:{color:"lightgray",round:100,border:1,borderColor:"rgba(0, 0, 0, 0.6)"},btnScrollDown:{color:"lightgray",round:100,border:1,borderColor:"rgba(0, 0, 0, 0.6)"},boxSort:{color:"#65A293"}},searchInputParams:{styleName:"original",width:"50%",height:36,border:1,round:8,color:"white",searchIconSize:16,placeholder:"Filter",fontSize:16,borderColor:Black(.15),borderBottomStyle:"1px solid "+Black(.15),searchIconFile:SmartTableDefaults.searchInputParams.searchIconFile,searchIconOpacity:.8}}},SmartTable.styles.classic=SmartTable.styles.light,SmartTable.createMinimalStyle=function(t){return{titleHeight:30,itemHeight:28,infoHeight:28,style:Object.assign({round:4,line1Color:t.ground,line2Color:t.ground,highlightItemCellColor:t.hover,selectedItemCellColor:t.selected,selectedBar:{width:2,color:t.ink},focusRingColor:t.focus,highlightTitleCellColor:t.ground,titleUppercase:0,invertIconColor:t.invertIcons,sortIcon:{size:14,opacity:.3,activeOpacity:1},cellTooltip:{fontSize:12,color:t.ground,textColor:t.text,round:4,border:1,borderColor:t.line,shadow:"none"},box:{color:t.ground},boxBorder:{border:1,borderColor:t.line},boxTitleLine:{color:t.ground},boxTitleCell:{padding:[10,0],borderRight:"none",borderBottom:"1px solid "+t.line},lblTitleCell:{fontSize:12,fontFamily:"opensans-bold",textColor:t.softText},boxItemCell:{borderBottom:"1px solid "+t.track,borderRight:"none",padding:[10,0]},lblItemCell:{fontSize:13,textColor:t.text,fontFamily:"opensans"},boxInfoLine:{color:t.ground,borderTop:"1px solid "+t.line},lblBoxInfoLine:{fontSize:12,textColor:t.softText},lblNoDataFound:{color:"transparent",textColor:t.softText,fontSize:12},lblSearchTitle:{color:"transparent",textColor:t.softText,fontSize:11,border:0,borderColor:"transparent"},btnScrollCenter:{color:t.ground,borderColor:t.line},btnScrollUp:{color:t.ground,borderColor:t.line},btnScrollDown:{color:t.ground,borderColor:t.line}},t.icons),searchInputParams:{styleName:t.minimalName,height:22,fontSize:12,searchIconSize:12,searchIconLeft:8},scrollBarParams:{bar_color:t.scrollBar,bar_mouseOverColor:t.scrollBar,bar_width:3},searchTitleMenuParams:{styleName:t.minimalName}}},SmartTable.MINIMAL_COLORS={ground:"#FFFFFF",text:Black(.85),softText:Black(.55),line:Black(.2),track:Black(.08),hover:Black(.03),selected:Black(.06),ink:"#1F1F1F",focus:"#3D8BD9",scrollBar:"#9A9A98",invertIcons:0,minimalName:"minimal",icons:{}},SmartTable.styles.minimal=SmartTable.createMinimalStyle(SmartTable.MINIMAL_COLORS),SmartTable.MINIMAL_DARK_COLORS={ground:"#1A1A19",text:White(.88),softText:White(.55),line:White(.18),track:White(.08),hover:White(.04),selected:White(.08),ink:"#EDEDEB",focus:"#7FB6DE",scrollBar:"#A0A0A0",invertIcons:1,minimalName:"minimalDark",icons:{btnScrollCenterIconFile:SmartTable.styles.dark.style.btnScrollCenterIconFile,searchTitleCheckIconFile:SmartTable.styles.dark.style.searchTitleCheckIconFile}},SmartTable.styles.minimalDark=SmartTable.createMinimalStyle(SmartTable.MINIMAL_DARK_COLORS);
|
|
19
|
+
;
|
|
20
|
+
/* Bismillah */
|
|
21
|
+
"use strict";const ToastDefaults={key:"",type:"info",titleText:"",messageText:"",allowHtml:0,duration:null,closable:1,showProgress:1,pauseOnHover:1,action:null,position:null,theme:null,scale:null,onClick:null,onClose:function(t,o){},style:{card:{round:10,padding:[14,12],gap:12,border:1},icon:{size:20,marginTop:1},texts:{gap:2},title:{fontSize:14},message:{fontSize:13},action:{fontSize:13,padding:[10,4],round:6,marginTop:6},close:{size:24,iconSize:16,round:6,marginTop:-2,marginRight:-4},progress:{height:3,opacity:.45}}},Toast=function(t={}){t.styleName&&console.warn('Toast: styleName is not used. The colors come with theme ("light", "dark", "auto", "minimal", "minimalDark"), the shapes with style.');const o=Toast.THEMES[t.theme||Toast.options.theme];if(o&&o.style){const e={};mergeIntoIfMissing(e,t.style||{}),mergeIntoIfMissing(e,o.style),t.style=e}mergeIntoIfMissing(t,ToastDefaults);const e=Toast.options,n=Toast.POSITIONS.includes(t.position)?t.position:e.position;if(t.key){const o=Toast.list.find(function(o){return o.key==t.key&&!o.isClosing});if(o)return o.update(t),o.bump(),o}const s=t.action,i=t.onClick;t.scale=Toast.getScale(t.scale),t.style=basic.scaleStyle(t.style,t.scale),t.width="100%",t.height="auto",t.color="transparent",t.position="relative";const a=Toast.getContainer(n),r=n.startsWith("bottom"),l=getDefaultContainerBox();setDefaultContainerBox(a);let c=startObject(t);const u=c.style;let g=null,d=null,p=0,f=0,h=0,b=0;const m=16*c.scale,T=12*c.scale,x="0.2s",y="0.16s";c.toastPosition=n,c.action=s,c.onClick=i,c.isClosing=0;const w=function(){return basic.resolveTheme(Toast.THEMES,c.theme||e.theme)},C=function(t){return 1==c.allowHtml?String(t):Toast.escapeHtml(t)},S=function(){return c.toastPosition.endsWith("left")?{x:-m,y:0}:c.toastPosition.endsWith("right")?{x:m,y:0}:{x:0,y:r?T:-T}},k=function(){const t=w(),o=t.colors[c.type]||t.colors.info,e="error"==c.type;c.card.color=t.background,c.card.borderColor=t.border,c.card.boxShadow=basic.scaleCssText(t.shadow,c.scale),c.card.role=e?"alert":"status",c.card.aria={live:e?"assertive":"polite"},c.card.cursor=c.onClick?"pointer":"default",c.icon.text=Toast.getIconSvg(c.type,o,u.icon.size),c.lblTitle.visible=c.titleText?1:0,c.lblTitle.text=C(c.titleText),c.lblTitle.textColor=t.title,c.lblMessage.visible=c.messageText?1:0,c.lblMessage.text=C(c.messageText),c.lblMessage.textColor=c.titleText?t.message:t.title;const n=!(!c.action||!c.action.text);c.btnAction.visible=n?1:0,n&&(c.btnAction.plainText=c.action.text,c.btnAction.textColor=t.actionText||o,c.btnAction.color=t.actionFill||Toast.alpha(o,.12)),c.btnClose.visible=1==c.closable?1:0,c.btnClose.text=Toast.getCloseSvg(t.close,u.close.iconSize),c.progress.color=o},v=function(t,o){const e=c.progress.css;o&&(e.transition="none",e.width="100%",c.progress.elem.offsetWidth),e.transition="width "+t+"ms linear",e.width="0%"},A=function(){f=Date.now(),g=c.after(p,function(){g=null,c.close("timeout")})},z=function(){g&&g(),g=null},B=function(){z();const t=null!==c.duration&&void 0!==c.duration?c.duration:e.durations[c.type]??4e3,o=t>0&&1==c.showProgress;c.progress.visible=o?1:0,t>0?(p=t,E()?c.progress.css={transition:"none",width:"100%"}:(A(),o&&v(p,!0))):p=0},E=function(){return 1==c.pauseOnHover&&(h||b)||document.hidden},H=function(){g&&(z(),p=Math.max(0,p-(Date.now()-f)),function(){const t=c.progress.css,o=window.getComputedStyle(c.progress.elem).width;t.transition="none",t.width=o}())},M=function(){c&&(E()?H():!g&&p>0&&!E()&&!c.isClosing&&(A(),c.progress.visible&&v(p,!1)))};c.update=function(t={}){return!c||c.isClosing||(["type","titleText","messageText","allowHtml","duration","closable","showProgress","pauseOnHover","theme","onClick","action"].forEach(function(o){o in t&&(c[o]=t[o])}),"duration"in t||(c.duration=null),k(),B()),c},c.bump=function(){if(!c)return;const t=c.card.css;t.transition="transform 0.12s",t.transform="scale(1.03)",c.after(120,function(){t.transform="scale(1)"})},c.close=function(t="api"){if(!c||c.isClosing)return;c.isClosing=1,z(),d&&d(),Toast.list=Toast.list.filter(function(t){return t!==c});const o=c,e=o.card.css,n=S();e.transition="opacity 0.16s, transform "+y,e.opacity="0",e.transform="translate("+n.x+"px, "+n.y+"px) scale(0.98)",setTimeout(function(){const e=o.css;e.height=o.elem.offsetHeight+"px",o.elem.offsetHeight,e.transition="height 0.16s, padding "+y,e.height="0px",e.paddingTop="0px",e.paddingBottom="0px",setTimeout(function(){o.onClose(o,t),o.remove(),c===o&&(c=null)},170)},150)};const F=c.remove;c.superRemove=F,c.remove=function(){c&&(Toast.list=Toast.list.filter(function(t){return t!==c}),F.call(c),c=null)},c.css={overflow:"visible",boxSizing:"border-box"},c.css[r?"paddingTop":"paddingBottom"]=e.gap*Toast.getScale()+"px",c.card=HGroup({width:"100%",height:"auto",align:"left top",gap:u.card.gap,padding:u.card.padding,border:u.card.border,round:u.card.round,clickable:1,position:"relative"}),c.card.css={overflow:"hidden",boxSizing:"border-box",outline:"none"},c.card.tabIndex=-1,c.icon=Label({text:"",width:u.icon.size,height:u.icon.size}),c.icon.shrink=0,c.icon.lineHeight="0",c.icon.css.marginTop=u.icon.marginTop+"px",c.icon.aria={hidden:"true"},c.textGroup=VGroup({width:"auto",height:"auto",align:"left top",gap:u.texts.gap}),c.textGroup.css={flex:"1 1 auto",minWidth:"0"},c.lblTitle=Label({text:"",width:"100%",fontSize:u.title.fontSize}),c.lblTitle.css={fontFamily:"opensans-bold",overflowWrap:"anywhere"},c.lblMessage=Label({text:"",width:"100%",fontSize:u.message.fontSize}),c.lblMessage.css.overflowWrap="anywhere",c.lblMessage.lineHeight="1.45",c.btnAction=Label({text:"",fontSize:u.action.fontSize,padding:u.action.padding,round:u.action.round,clickable:1}),c.btnAction.css={fontFamily:"opensans-bold",marginTop:u.action.marginTop+"px"},c.btnAction.cursor="pointer",c.btnAction.tabIndex=0,c.btnAction.role="button",endGroup(),c.btnClose=Label({text:"",width:u.close.size,height:u.close.size,round:u.close.round,clickable:1}),c.btnClose.shrink=0,c.btnClose.lineHeight="0",c.btnClose.cursor="pointer",c.btnClose.elem.style.display="flex";const I=u.close.marginTop+"px "+u.close.marginRight+"px 0 0";c.btnClose.css={alignItems:"center",justifyContent:"center",margin:I},c.btnClose.tabIndex=0,c.btnClose.role="button",c.btnClose.aria={label:"Close"},c.progress=Box({width:"100%",height:u.progress.height,opacity:u.progress.opacity}),endGroup(),c.progress.position="absolute",c.progress.left=0,c.progress.bottom=0,r||a.elem.firstChild===c.elem||a.elem.insertBefore(c.elem,a.elem.firstChild);const W=function(t,o){"Enter"!=t.key&&" "!=t.key||(t.preventDefault(),o())},D=function(){if(!c||!c.action||c.isClosing)return;!1!==("function"==typeof c.action.onClick?c.action.onClick(c):void 0)&&c.close("action")};c.btnAction.on("click",D),c.btnAction.on("keydown",function(t,o){W(o,D)});const O=function(){c.close("close")};c.btnClose.on("click",O),c.btnClose.on("keydown",function(t,o){W(o,O)}),c.btnClose.on("mouseover",function(){c.btnClose.color=w().closeHover}),c.btnClose.on("mouseout",function(){c.btnClose.color="transparent"}),c.card.on("click",function(t,o){c&&c.onClick&&(c.btnAction.elem.contains(o.target)||c.btnClose.elem.contains(o.target)||c.onClick(c))}),c.card.on("keydown",function(t,o){"Escape"==o.key&&c&&1==c.closable&&c.close("close")}),c.card.on("mouseenter",function(){h=1,M()}),c.card.on("mouseleave",function(){h=0,M()}),c.card.on("focusin",function(){b=1,M()}),c.card.on("focusout",function(){b=0,M()}),d=c.listenTo(document,"visibilitychange",function(){M()}),k();const _=c.card.css,P=S();_.opacity="0",_.transform="translate("+P.x+"px, "+P.y+"px) scale(0.98)",c.card.elem.offsetWidth,_.transition="opacity 0.2s, transform "+x,_.opacity="1",_.transform="translate(0px, 0px) scale(1)",Toast.list.push(c),endObject(c),setDefaultContainerBox(l),B();const L=Toast.list.filter(function(t){return t.toastPosition==n});return L.length>e.maxVisible&&L.slice(0,L.length-e.maxVisible).forEach(function(t){t.close("limit")}),c};Toast.POSITIONS=["top-right","top-center","top-left","bottom-right","bottom-center","bottom-left"],Toast.options={position:"top-right",theme:"auto",width:360,offset:16,offsetTop:null,offsetBottom:null,gap:10,maxVisible:5,zIndex:45e3,smallScreenWidth:520,durations:{success:3e3,info:4e3,warning:5e3,error:7e3,loading:0},scale:null},Toast.THEMES={light:{background:"#FFFFFF",border:"rgba(11, 11, 11, 0.08)",shadow:"0 8px 28px rgba(0, 0, 0, 0.14)",title:"#1B1B1A",message:"#5F5E5A",close:"rgba(11, 11, 11, 0.45)",closeHover:"rgba(11, 11, 11, 0.06)",colors:{success:"#15935F",error:"#D93F3E",warning:"#B77A00",info:"#2A78D6",loading:"#6B6A65"}},dark:{background:"#262625",border:"rgba(255, 255, 255, 0.10)",shadow:"0 8px 28px rgba(0, 0, 0, 0.5)",title:"rgba(255, 255, 255, 0.95)",message:"rgba(255, 255, 255, 0.65)",close:"rgba(255, 255, 255, 0.5)",closeHover:"rgba(255, 255, 255, 0.08)",colors:{success:"#3CC08A",error:"#EF6B6A",warning:"#E8B23A",info:"#5A9CF0",loading:"rgba(255, 255, 255, 0.7)"}}},Toast.MINIMAL_SHAPES={card:{round:4,padding:[12,10],gap:10,border:1},icon:{size:16,marginTop:1},title:{fontSize:13},message:{fontSize:12},action:{fontSize:12,padding:[0,2],round:4,marginTop:4},close:{size:20,iconSize:14,round:4,marginTop:-2,marginRight:-4},progress:{height:2,opacity:.45}},Toast.THEMES.minimal={background:"#FFFFFF",border:Black(.2),shadow:"none",title:Black(.85),message:Black(.55),close:Black(.45),closeHover:Black(.05),actionText:"#1F1F1F",actionFill:"transparent",colors:{success:"#2E9E74",error:"#C24A36",warning:"#B77A00",info:"#3D8BD9",loading:Black(.55)},style:Toast.MINIMAL_SHAPES},Toast.THEMES.minimalDark={background:"#1A1A19",border:White(.18),shadow:"none",title:White(.88),message:White(.55),close:White(.5),closeHover:White(.06),actionText:"#EDEDEB",actionFill:"transparent",colors:{success:"#7FE3B5",error:"#FF9F93",warning:"#E8B23A",info:"#7FB6DE",loading:White(.55)},style:Toast.MINIMAL_SHAPES},Toast.list=[],Toast._containers={},Toast._isResizeListening=0,Toast._layoutScale=1,Toast.show=function(t={}){return Toast(t)},Toast.success=function(t,o={}){return Toast(Object.assign({},o,{type:"success",messageText:t}))},Toast.error=function(t,o={}){return Toast(Object.assign({},o,{type:"error",messageText:t}))},Toast.warning=function(t,o={}){return Toast(Object.assign({},o,{type:"warning",messageText:t}))},Toast.info=function(t,o={}){return Toast(Object.assign({},o,{type:"info",messageText:t}))},Toast.promise=function(t,o={},e={}){const n=Toast(Object.assign({},e,{type:"loading",messageText:o.loading||"Loading...",duration:0,closable:0})),s=function(t,o){return"function"==typeof t?t(o):t};return t.then(function(t){n.update({type:"success",messageText:s(o.success,t)||"Done.",closable:1})},function(t){n.update({type:"error",messageText:s(o.error,t)||"Something went wrong.",closable:1})}),t},Toast.closeAll=function(){Toast.list.slice().forEach(function(t){t.close("api")})},Toast.setOptions=function(t={}){Object.keys(t).forEach(function(o){"durations"==o?Object.assign(Toast.options.durations,t.durations):Toast.options[o]=t[o]}),Toast.layoutContainers()},Toast.getContainer=function(t){let o=Toast._containers[t];if(o&&o.elem.isConnected)return Toast.getScale()!==Toast._layoutScale&&Toast.layoutContainers(),o;const e=getDefaultContainerBox();return setDefaultContainerBox(page),o=VGroup({width:Toast.options.width,height:"auto",align:t.endsWith("left")?"left top":t.endsWith("right")?"right top":"center top",gap:0}),o.css={alignItems:"stretch",overflow:"visible"},o.role="region",o.aria={label:"Notifications"},endGroup(),setDefaultContainerBox(e),o.toastPosition=t,Toast._containers[t]=o,Toast._isResizeListening||(Toast._isResizeListening=1,page.onResize(function(){Toast.layoutContainers()})),Toast.layoutContainers(),o},Toast.getScale=function(t=null){return t??Toast.options.scale??basic.uiScale},Toast.layoutContainers=function(){const t=Toast.options,o=Toast.getScale(),e=t.offset*o,n=(t.offsetTop??t.offset)*o,s=(t.offsetBottom??t.offset)*o,i=page.width<t.smallScreenWidth*o;Toast._layoutScale=o,Object.keys(Toast._containers).forEach(function(a){const r=Toast._containers[a].css;if(r.position="absolute",r.zIndex=String(t.zIndex),r.top="",r.bottom="",r.left="",r.right="",r.transform="none",r.maxWidth="calc(100% - "+2*e+"px)",a.startsWith("top")?r.top=n+"px":r.bottom=s+"px",i)return r.left=e+"px",void(r.width="calc(100% - "+2*e+"px)");r.width=t.width*o+"px",a.endsWith("left")?r.left=e+"px":a.endsWith("right")?r.right=e+"px":(r.left="50%",r.transform="translateX(-50%)")})},Toast.escapeHtml=basic.escapeHtml,Toast.alpha=function(t,o){if(!/^#[0-9a-f]{6}$/i.test(t))return t.replace(/[\d.]+\)$/,o+")");const e=parseInt(t.slice(1),16);return"rgba("+(e>>16)+", "+(e>>8&255)+", "+(255&e)+", "+o+")"},Toast.ICON_PATHS={success:'<circle cx="12" cy="12" r="10"/><path d="m7.5 12.5 3 3 6-6.5"/>',error:'<circle cx="12" cy="12" r="10"/><path d="M15 9l-6 6M9 9l6 6"/>',warning:'<path d="M10.3 3.9 2.4 17.6A2 2 0 0 0 4.1 20.6h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/><path d="M12 9.5v4M12 17h.01"/>',info:'<circle cx="12" cy="12" r="10"/><path d="M12 11v5.5M12 7.5h.01"/>',loading:'<circle cx="12" cy="12" r="9" opacity="0.25"/><path d="M21 12a9 9 0 0 0-9-9"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="0.8s" repeatCount="indefinite"/></path>'},Toast.getIconSvg=function(t,o,e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none" stroke="'+o+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+(Toast.ICON_PATHS[t]||Toast.ICON_PATHS.info)+"</svg>"},Toast.getCloseSvg=function(t,o=16){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+o+'" viewBox="0 0 24 24" fill="none" stroke="'+t+'" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12M18 6 6 18"/></svg>'};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<title>Tauri Starter</title>
|
|
6
|
+
|
|
7
|
+
<meta charset="UTF-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
|
|
10
|
+
<!-- LIBRARY FILES -->
|
|
11
|
+
<link rel="preload" href="basic/font/open-sans/OpenSans-Regular.ttf" as="font" crossorigin="anonymous">
|
|
12
|
+
<link rel="preload" href="basic/font/open-sans/OpenSans-Bold.ttf" as="font" crossorigin="anonymous">
|
|
13
|
+
<link rel="stylesheet" type="text/css" href="basic/basic.min.css">
|
|
14
|
+
<script src="basic/basic.min.js" type="text/javascript" charset="utf-8"></script>
|
|
15
|
+
<script src="basic/scroll-bar.min.js" type="text/javascript" charset="utf-8"></script>
|
|
16
|
+
|
|
17
|
+
<!-- COMPONENTS -->
|
|
18
|
+
<script src="comp/components.min.js" type="text/javascript" charset="utf-8"></script>
|
|
19
|
+
|
|
20
|
+
<!-- THE APP: backend.js calls the Rust side, app.js draws the page and lists the folders (the first
|
|
21
|
+
example), sizes.js measures the folders with the events of Rust (the second example) -->
|
|
22
|
+
<script src="backend.js" type="text/javascript" charset="utf-8"></script>
|
|
23
|
+
<script src="app.js" type="text/javascript" charset="utf-8"></script>
|
|
24
|
+
<script src="sizes.js" type="text/javascript" charset="utf-8"></script>
|
|
25
|
+
|
|
26
|
+
</head>
|
|
27
|
+
<body></body>
|
|
28
|
+
</html>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
sizes.js - Tauri Starter v0.1 (OzdenUI for Tauri)
|
|
6
|
+
|
|
7
|
+
THE SECOND EXAMPLE: a long job in Rust that sends events to the page (src-tauri/src/sizes.rs).
|
|
8
|
+
"Sizes" measures every folder of the open folder in a thread of Rust. The page listens to its events:
|
|
9
|
+
"measure-folder" gives a folder row its size, "measure-progress" counts the files in the status bar,
|
|
10
|
+
"measure-done" ends it. "Stop" stops the job; opening another folder stops it too.
|
|
11
|
+
|
|
12
|
+
Started Date: November 2026
|
|
13
|
+
Webpage: https://bug7a.github.io/ozdenui-tauri-template/
|
|
14
|
+
|
|
15
|
+
Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
|
|
16
|
+
Licensed under the Apache License, Version 2.0
|
|
17
|
+
SPDX-License-Identifier: Apache-2.0
|
|
18
|
+
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
"use strict";
|
|
22
|
+
|
|
23
|
+
const Sizes = {};
|
|
24
|
+
|
|
25
|
+
Sizes.ICON = lineIcon('<circle cx="12" cy="12" r="9"/><path d="M12 3v9l6.4 6.4"/>');
|
|
26
|
+
Sizes.STOP_ICON = lineIcon('<rect x="7" y="7" width="10" height="10" rx="1.5"/>');
|
|
27
|
+
|
|
28
|
+
Sizes.lastJob = 0;
|
|
29
|
+
Sizes.job = 0; // the number of the running job (0: none). WHY: an event of an old job is not shown
|
|
30
|
+
Sizes.measured = new Map(); // path -> bytes: a measured folder keeps its size when its rows are made again
|
|
31
|
+
Sizes.button = null;
|
|
32
|
+
|
|
33
|
+
// SMART BUTTON: "Sizes", "Stop" while Rust measures (in the top bar)
|
|
34
|
+
Sizes.createButton = function () {
|
|
35
|
+
Sizes.button = SmartButton({ labelText: "Sizes", iconFile: Sizes.ICON, onClick: Sizes.onClick });
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// The events of Rust: listened to once, when the page starts
|
|
39
|
+
Sizes.listen = function () {
|
|
40
|
+
Backend.listen("measure-progress", Sizes.showProgress);
|
|
41
|
+
Backend.listen("measure-folder", Sizes.showFolderSize);
|
|
42
|
+
Backend.listen("measure-done", Sizes.showDone);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
Sizes.onClick = function () {
|
|
46
|
+
if (Sizes.job) {
|
|
47
|
+
Backend.stopMeasure();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
Sizes.start();
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
Sizes.start = function () {
|
|
54
|
+
if (!currentFolder) return;
|
|
55
|
+
Sizes.lastJob++;
|
|
56
|
+
Sizes.job = Sizes.lastJob;
|
|
57
|
+
Sizes.showRunning(1);
|
|
58
|
+
lblSpeed.plainText = "Rust is measuring the folders...";
|
|
59
|
+
Backend.measureFolder(currentFolder.path, Sizes.job).catch(showError);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// A new folder is opened: the measure of the old one stops (its sizes are not for these rows)
|
|
63
|
+
Sizes.stop = function () {
|
|
64
|
+
if (!Sizes.job) return;
|
|
65
|
+
Sizes.job = 0;
|
|
66
|
+
Sizes.showRunning(0);
|
|
67
|
+
Backend.stopMeasure();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// The size of a folder row: measured before, or not yet (NO_SIZE)
|
|
71
|
+
Sizes.sizeOf = function (path) {
|
|
72
|
+
return Sizes.measured.has(path) ? Sizes.measured.get(path) : NO_SIZE;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// *** THE EVENTS OF RUST:
|
|
76
|
+
|
|
77
|
+
// { job, files, bytes }: the files counted so far
|
|
78
|
+
Sizes.showProgress = function (progress) {
|
|
79
|
+
if (progress.job != Sizes.job) return;
|
|
80
|
+
lblSpeed.plainText = "Measuring: " + countText(progress.files, "file") + ", " + formatSize(progress.bytes);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// { job, path, files, bytes }: a folder inside is measured
|
|
84
|
+
Sizes.showFolderSize = function (folderSize) {
|
|
85
|
+
if (folderSize.job != Sizes.job) return;
|
|
86
|
+
Sizes.measured.set(folderSize.path, folderSize.bytes);
|
|
87
|
+
setRowSize(folderSize.path, folderSize.bytes);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// { job, files, bytes, millis, stopped }: the end
|
|
91
|
+
Sizes.showDone = function (done) {
|
|
92
|
+
if (done.job != Sizes.job) return;
|
|
93
|
+
Sizes.job = 0;
|
|
94
|
+
Sizes.showRunning(0);
|
|
95
|
+
const total = formatSize(done.bytes) + " in " + countText(done.files, "file") + " (" + formatMillis(done.millis) + ")";
|
|
96
|
+
const measuredBy = Backend.isInApp() ? "Measured by Rust: " : "Measured (sample data): ";
|
|
97
|
+
lblSpeed.plainText = (done.stopped ? "Stopped: " : measuredBy) + total;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
Sizes.showRunning = function (isRunning) {
|
|
101
|
+
Sizes.button.setLabelText(isRunning ? "Stop" : "Sizes");
|
|
102
|
+
Sizes.button.setIcon(isRunning ? Sizes.STOP_ICON : Sizes.ICON);
|
|
103
|
+
Sizes.button.setTone(isRunning ? "orange" : "");
|
|
104
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.6
|
|
@@ -28,6 +28,7 @@ THE SPACE AFTER THE NAME: layout.labelEndSpace (and the empty side of an icon bo
|
|
|
28
28
|
the name, so the selected box looks even at both ends.
|
|
29
29
|
KEYBOARD AND SCREEN READERS: every item is a button named by its text ("Tab 1"... without a text); the Tab key
|
|
30
30
|
reaches it, Enter / Space choose it like a click.
|
|
31
|
+
MOTION: the first view shows at once (also a selectByIndex() of the page at start); a change after it moves.
|
|
31
32
|
|
|
32
33
|
USAGE:
|
|
33
34
|
const bar = BottomBar({
|
|
@@ -152,13 +153,14 @@ const BottomBar = function (params = {}) {
|
|
|
152
153
|
const BAR_WIDTH = 350; // The first width of the bar; refresh() gives it the width of its items.
|
|
153
154
|
const SELECTED_BOX_WIDTH = 142; // The first width; refresh() sets it around the selected item.
|
|
154
155
|
const LABEL_FIRST_LEFT = 12;
|
|
155
|
-
const LABEL_RAISE = 2; // px above the center line: it looks centered next to the icon.
|
|
156
156
|
const HOVER_ICON_OPACITY = 0.5;
|
|
157
157
|
const REFRESH_DELAY = 3; // ms: many changes in a row make one refresh.
|
|
158
158
|
const stillClipContent = box.clipContent; // WHY: "float" lets the pill stand over the bar; another mode puts it back.
|
|
159
159
|
let isFloatLabelWaiting = 1; // 1: the next refresh() shows the name over the selected item (the first view, a selection)
|
|
160
160
|
let isFloatLabelPlaced = 0;
|
|
161
161
|
let cancelFloatLabelHide = null; // The cancel function of the timer that fades the name out (box.after)
|
|
162
|
+
let isFirstView = 1; // 1: refresh() places the bar at once, without motion
|
|
163
|
+
let isPlaced = 0; // 1: refresh() placed the items once
|
|
162
164
|
|
|
163
165
|
// *** PUBLIC VARIABLES:
|
|
164
166
|
box.itemObjList = [];
|
|
@@ -325,8 +327,29 @@ const BottomBar = function (params = {}) {
|
|
|
325
327
|
if (box.lblFloat) box.clipContent = stillClipContent; // "float" was on before
|
|
326
328
|
};
|
|
327
329
|
|
|
330
|
+
// THE FIRST VIEW: the bar shows at once; only a change after it moves.
|
|
331
|
+
// WHY: On a slow load the first refresh() came after setMotion() was on, and so did the ones after it (the width of
|
|
332
|
+
// a name is known only after it is drawn): the bar grew and the items slid in.
|
|
333
|
+
const stopMotions = function () {
|
|
334
|
+
box.innerBox.dontMotion();
|
|
335
|
+
box.selectedBox.dontMotion();
|
|
336
|
+
box.itemObjList.forEach(function (item) {
|
|
337
|
+
item.icon.dontMotion();
|
|
338
|
+
item.icon.i1.dontMotion();
|
|
339
|
+
item.icon.i2.dontMotion();
|
|
340
|
+
item.label.dontMotion();
|
|
341
|
+
});
|
|
342
|
+
if (box.lblFloat) box.lblFloat.dontMotion();
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
// A change after the bar is placed moves; one before it (Ex: the page selects its tab at start) is the first view.
|
|
346
|
+
const endFirstView = function () {
|
|
347
|
+
if (isPlaced) isFirstView = 0;
|
|
348
|
+
};
|
|
349
|
+
|
|
328
350
|
// The user chose an item: a click, Enter or Space.
|
|
329
351
|
const selectByUser = function (itemView, index) {
|
|
352
|
+
endFirstView();
|
|
330
353
|
box.selectedIndex = index;
|
|
331
354
|
isFloatLabelWaiting = 1;
|
|
332
355
|
box.onItemClick(box, itemView, index);
|
|
@@ -438,8 +461,6 @@ const BottomBar = function (params = {}) {
|
|
|
438
461
|
setText(itemView.label, itemData.text);
|
|
439
462
|
itemView.label.css = { whiteSpace: "nowrap" }; // WHY: A name of two words broke while the bar was growing.
|
|
440
463
|
box.innerBox.add(itemView.label);
|
|
441
|
-
itemView.label.center("top");
|
|
442
|
-
itemView.label.top -= LABEL_RAISE;
|
|
443
464
|
itemView.label.setMotion("left 0.3s, opacity 0.3s");
|
|
444
465
|
itemView.label.aria = { hidden: true }; // WHY: The text is the name of the button of the item (its icon box).
|
|
445
466
|
itemView.label.onResize(box.refreshOneTime); // WHY: The width of the label is known only after it is drawn.
|
|
@@ -472,11 +493,13 @@ const BottomBar = function (params = {}) {
|
|
|
472
493
|
// USAGE: bar.setBadge(1, 5)
|
|
473
494
|
|
|
474
495
|
box.selectNone = function () {
|
|
496
|
+
endFirstView();
|
|
475
497
|
box.selectedIndex = -1;
|
|
476
498
|
box.refreshOneTime();
|
|
477
499
|
};
|
|
478
500
|
|
|
479
501
|
box.selectByIndex = function (index) {
|
|
502
|
+
endFirstView();
|
|
480
503
|
box.selectedIndex = index;
|
|
481
504
|
isFloatLabelWaiting = 1; // The name shows over it ("float").
|
|
482
505
|
box.refreshOneTime();
|
|
@@ -484,6 +507,7 @@ const BottomBar = function (params = {}) {
|
|
|
484
507
|
// USAGE: get: bar.selectedIndex, set: bar.selectByIndex(2)
|
|
485
508
|
|
|
486
509
|
box.setLabelMode = function (mode) {
|
|
510
|
+
endFirstView();
|
|
487
511
|
box.labelMode = mode;
|
|
488
512
|
applyLabelMode();
|
|
489
513
|
box.refreshOneTime();
|
|
@@ -497,12 +521,14 @@ const BottomBar = function (params = {}) {
|
|
|
497
521
|
const _barPadding = getBarPadding();
|
|
498
522
|
let _currentLeft = _barPadding;
|
|
499
523
|
|
|
524
|
+
if (isFirstView) stopMotions();
|
|
500
525
|
if (box.selectedIndex == -1) box.selectedBox.opacity = 0;
|
|
501
526
|
|
|
502
527
|
box.itemObjList.forEach((item, index) => {
|
|
503
528
|
const isSelected = (index == box.selectedIndex);
|
|
504
529
|
item.icon.left = _currentLeft;
|
|
505
530
|
item.label.left = getLabelLeft(item, isSelected);
|
|
531
|
+
item.label.center("top"); // WHY here: its height changes when its font loads (onResize calls refresh).
|
|
506
532
|
paintItem(item, isSelected);
|
|
507
533
|
if (isSelected) placeSelectedBox(item);
|
|
508
534
|
_currentLeft += getItemWidth(item, isSelected) + _layout.itemSpacing;
|
|
@@ -513,6 +539,8 @@ const BottomBar = function (params = {}) {
|
|
|
513
539
|
box.innerBox.center();
|
|
514
540
|
|
|
515
541
|
refreshFloatLabel();
|
|
542
|
+
if (isFirstView) void box.innerBox.elem.offsetHeight; // WHY: The places are drawn now: a page busy for 40 ms drew them after dontMotion() ended.
|
|
543
|
+
isPlaced = 1;
|
|
516
544
|
|
|
517
545
|
};
|
|
518
546
|
|