PageSourceSearch

https://spc.sy/chunk-6M7RL5BO.js

js spc.sy collected 2026-10-10 01:31:13 UTC 8,614 bytes, 8 lines download raw bytes

1import{a as Q}from"./chunk-D3GPRQ4Y.js";import{a as R}from"./chunk-KB4DL65J.js";import{a as P}from"./chunk-MW6KAL6O.js";import{a as H}from"./chunk-RRIV533A.js";import{b as k}from"./chunk-DUANR54R.js";import{j,k as z,r as O}from"./chunk-PTQIIAB4.js";import{c as A}from"./chunk-FJ7EFM7G.js";import{$b as T,C as B,Dc as u,Ec as g,Hb as d,Ib as i,Jb as a,Kb as C,Ob as y,Pb as w,Rb as L,Ua as o,Vb as c,Xb as h,Z as F,ac as I,bc as E,ca as S,da as x,ea as v,fa as b,ib as N,kc as m,lc as D,ma as p,mc as _,ob as f,q as V,wc as M}from"./chunk-7FIIEFNI.js";var $=()=>[1,2,3,4,5],G=()=>[1,2,3];function U(r,t){r&1&&(i(0,"td",24),C(1,"div",25),a())}function Z(r,t){r&1&&(i(0,"tr",22),f(1,U,2,0,"td",23),a()),r&2&&(o(),d("ngForOf",M(1,G)))}function J(r,t){r&1&&(y(0),f(1,Z,2,2,"tr",21),w()),r&2&&(o(),d("ngForOf",M(1,$)))}function K(r,t){if(r&1){let e=L();i(0,"tr",27)(1,"td",24),m(2),a(),i(3,"td",28)(4,"span",29),m(5),a()(),i(6,"td",30)(7,"button",31),c("click",function(){let s=S(e).$implicit,l=h(2);return x(l.onEdit(s))}),v(),i(8,"svg",32),C(9,"path",33),a()(),b(),i(10,"button",34),c("click",function(){let s=S(e).$implicit,l=h(2);return x(l.onDelete(s))}),v(),i(11,"svg",35),C(12,"path",36),a()()()()}if(r&2){let e=t.$implicit,n=h(2);o(2),D(e.id),o(2),d("title",n.languageService.currentLang==="en"?e.nameEn:e.nameAr),o(),_(" ",n.languageService.currentLang==="en"?e.nameEn:e.nameAr," ")}}function W(r,t){if(r&1&&(y(0),f(1,K,13,3,"tr",26),w()),r&2){let e=h();o(),d("ngForOf",e.items())}}function X(r,t){r&1&&(i(0,"tr")(1,"td",37),m(2," No items found "),a()())}function Y(r,t){if(r&1){let e=L();i(0,"div",38)(1,"app-shared-pagination",39),c("pageChange",function(s){S(e);let l=h();return x(l.onPageChange(s))}),a()()}if(r&2){let e=h();o(),d("totalItems",e.totalRecords())("pageSize",e.pageSize())("currentPage",e.currentPage())}}var q=class r{service;title="";languageService=F(H);deleteProjectModal;modalSharedQSTComponent;items=p([]);totalRecords=p(0);isLoading=p(!0);pageSize=p(10);currentPage=p(1);search=p("");selectedItemId=p(null);constructor(){let t=k(this.search).pipe(B(300)),e=k(this.currentPage);V([t,e]).subscribe(([n,s])=>{this.loadItems(n,s)})}loadItems(t,e){this.isLoading.set(!0),this.service.getAll(t,e,this.pageSize()).subscribe({next:n=>{this.items.set(n.value),this.totalRecords.set(n.totalRecordsCount)},error:()=>{this.isLoading.set(!1)},complete:()=>{this.isLoading.set(!1)}})}onSearch(t){this.currentPage.set(1),this.search.set(t)}onPageChange(t){this.currentPage.set(t)}onAdd(){this.modalSharedQSTComponent.dialogTitle="features.crudShared.add."+this.title.toLowerCase(),this.modalSharedQSTComponent.show()}onEdit(t){this.modalSharedQSTComponent.dialogTitle="features.crudShared.edit."+this.title.toLowerCase(),this.modalSharedQSTComponent.show(t)}onDelete(t){this.selectedItemId.set(t.id),this.deleteProjectModal.show()}onCancelDelete(){this.selectedItemId.set(null)}onConfirmDelete(){let t=this.selectedItemId();t&&this.service.delete(+t).subscribe({next:e=>{e.isSuccess&&this.loadItems(this.search(),this.currentPage())},error:()=>{this.selectedItemId.set(null)},complete:()=>{this.selectedItemId.set(null)}})}onCreate(t){this.service.create(t).subscribe({next:e=>{e.isSuccess?(this.loadItems(this.search(),this.currentPage()),this.modalSharedQSTComponent.handleSuccess()):this.modalSharedQSTComponent.handleError(e)},error:e=>{this.modalSharedQSTComponent.handleError(e)}})}onUpdate(t){this.service.update(t).subscribe({next:e=>{e.isSuccess?(this.loadItems(this.search(),this.currentPage()),this.modalSharedQSTComponent.handleSuccess()):this.modalSharedQSTComponent.handleError(e)},error:e=>{this.modalSharedQSTComponent.handleError(e)}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["app-crud-list"]],viewQuery:function(e,n){if(e&1&&(T(P,5),T(Q,5)),e&2){let s;I(s=E())&&(n.deleteProjectModal=s.first),I(s=E())&&(n.modalSharedQSTComponent=s.first)}},inputs:{service:"service",title:"title"},decls:42,vars:25,consts:[[1,"w-full","overflow-x-auto","p-4"],[1,"flex","flex-col","md:flex-row","md:items-center","md:justify-between","mb-8","gap-3"],[1,"text-xl","font-bold","text-primary","flex","items-center","gap-2"],["aria-label","Breadcrumb",1,"flex","items-center","text-sm","text-gray-500"],[1,"inline-flex","items-center","space-x-1","md:space-x-2"],["href","/admin",1,"hover:text-primary","transition"],["fill","currentColor","viewBox","0 0 20 20",1,"w-4","h-4","text-gray-400"],["fill-rule","evenodd","d",`M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 
2              6.707a1 1 0 011.414-1.414l4 4a1 
3              1 0 010 1.414l-4 4a1 1 0 
4              01-1.414 0z`,"clip-rule","evenodd"],[1,"text-gray-700","font-medium"],[1,"flex","items-center","justify-between","gap-2","w-full","md:w-auto","mb-4"],["type","text",1,"w-full","md:w-64","pl-9","pr-3","py-1.5","rounded-lg","border","border-gray-400","focus:ring-1","focus:ring-accent","focus:outline-none","text-sm",3,"input","placeholder"],[1,"flex","items-center","gap-1","bg-accent","text-white","px-3","py-1.5","rounded-lg","hover:bg-accent/80","transition","text-sm","shadow-sm",3,"click"],[1,"overflow-x-auto","w-full","border","border-gray-400","rounded-lg"],[1,"min-w-full","bg-white","text-sm","text-start"],[1,"bg-primary/10","text-gray-700"],[1,"py-3","px-3","text-start","font-medium"],[1,"py-3","px-3","text-center","font-medium"],[4,"ngIf"],["class","mt-4",4,"ngIf"],[3,"confirm","cancel"],[3,"createData","updateData"],["class","animate-pulse",4,"ngFor","ngForOf"],[1,"animate-pulse"],["class","py-3 px-3",4,"ngFor","ngForOf"],[1,"py-3","px-3"],[1,"h-4","bg-gray-200","rounded","w-3/4"],["class","border-t border-gray-400",4,"ngFor","ngForOf"],[1,"border-t","border-gray-400"],[1,"py-3","px-3","w-4/5"],[1,"block","truncate",3,"title"],[1,"py-3","px-3","flex","justify-center","gap-1"],[1,"text-white","p-1.5","rounded-md","hover:brightness-90","transition","bg-gradient-to-r","from-primary-light","to-primary",3,"click"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor",1,"w-4","h-4"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d",`M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 
5                3.536L7.5 21H3v-4.5L16.732 3.732z`],[1,"text-white","p-1.5","rounded-md","hover:brightness-90","transition","bg-gradient-to-r","from-red-500","to-red-700",3,"click"],["viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"w-4","h-4"],["d",`M10 12V17M14 12V17M4 7H20M6 10V18C6 19.6569 7.34315 
6                   21 9 21H15C16.6569 21 18 19.6569 18 18V10M9 5C9 
7                   3.89543 9.89543 3 11 3H13C14.1046 3 15 3.89543 
8                   15 5V7H9V5Z`,"stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["colspan","3",1,"text-center","py-4","text-gray-500"],[1,"mt-4"],[3,"pageChange","totalItems","pageSize","currentPage"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"div",1)(2,"h2",2),m(3),u(4,"translate"),a(),i(5,"nav",3)(6,"ol",4)(7,"li")(8,"a",5),m(9),u(10,"translate"),a()(),i(11,"li"),v(),i(12,"svg",6),C(13,"path",7),a()(),b(),i(14,"li",8),m(15),u(16,"translate"),a()()()(),i(17,"div",9)(18,"input",10),u(19,"translate"),c("input",function(l){return n.onSearch(l.target.value)}),a(),i(20,"button",11),c("click",function(){return n.onAdd()}),m(21),u(22,"translate"),a()(),i(23,"div",12)(24,"table",13)(25,"thead",14)(26,"tr")(27,"th",15),m(28,"#"),a(),i(29,"th",15),m(30),u(31,"translate"),a(),i(32,"th",16),m(33),u(34,"translate"),a()()(),i(35,"tbody"),f(36,J,2,2,"ng-container",17)(37,W,2,1,"ng-container",17)(38,X,3,0,"tr",17),a()()(),f(39,Y,2,3,"div",18),i(40,"app-confirm-delete-modal",19),c("confirm",function(){return n.onConfirmDelete()})("cancel",function(){return n.onCancelDelete()}),a(),i(41,"app-modal-shared-q-s-t",20),c("createData",function(l){return n.onCreate(l)})("updateData",function(l){return n.onUpdate(l)}),a()()),e&2&&(o(3),_(" ",g(4,11,"layout.adminLayout.links."+n.title.toLowerCase())," "),o(6),_(" ",g(10,13,"layout.adminLayout.links.dashboard")," "),o(6),_(" ",g(16,15,"layout.adminLayout.links.skills")," "),o(3),d("placeholder",g(19,17,"features.jobs.searchPlaceholder")),o(3),_(" ",g(22,19,"features.crudShared.add."+n.title.toLowerCase())," "),o(9),D(g(31,21,"features.crudShared.name")),o(3),_(" ",g(34,23,"shared.actions")," "),o(3),d("ngIf",n.isLoading()),o(),d("ngIf",!n.isLoading()),o(),d("ngIf",!n.isLoading()&&n.items().length===0),o(),d("ngIf",!n.isLoading()&&n.items().length>0))},dependencies:[O,j,z,P,R,Q,A],encapsulation:2,changeDetection:0})};export{q as a};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.