import{a as C}from"./chunk-VGRXCTXL.js";import"./chunk-4G57JG5N.js";import"./chunk-MJMWESWV.js";import{a as y}from"./chunk-GBSIGLW2.js";import"./chunk-5EQUI3VP.js";import"./chunk-RQCMKSAN.js";import{I as R,f as w,j as E}from"./chunk-57DG2VC5.js";import"./chunk-NMMBNW5X.js";import"./chunk-5IDV7BCW.js";import"./chunk-CVFNZXIB.js";import{g as b}from"./chunk-EU5XKS65.js";import{c as f}from"./chunk-XALE2GEX.js";import"./chunk-GJIGZB63.js";import"./chunk-TOJME4VO.js";import"./chunk-2CD72B3Z.js";import"./chunk-4TDNJBFX.js";import"./chunk-4LZAXRJQ.js";import"./chunk-XHRSSCXW.js";import"./chunk-5VDVFGVW.js";import{p as u}from"./chunk-NLMVBXFK.js";import"./chunk-BUHB7MLU.js";import"./chunk-KUS3L5XF.js";import{Bc as e,Cc as I,Cd as v,Eb as c,Fb as S,Fd as h,Rc as g,Sc as x,Vb as a,cc as t,dc as i,ec as s,la as m,rb as o,sb as p}from"./chunk-J476KISY.js";var D=(()=>{class l{constructor(d){this.irisDialogService=d,this.irisNumberField={id:"irisNumber",label:"IRIS Help",component:E},this.irisConfig={irisNumber:""},this.irisRawPreview=null,this.irisAction={id:"iris-dialog",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:this.irisConfig.irisNumber,onLoaded:r=>{this.irisRawPreview=r}})}},this.exampleA={iris1:{id:"iris-dialog-a-1",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:"1006335"})}},iris2:{id:"iris-dialog-a-2",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:"1006335",irisActions:[{anNo:3,onSelected:()=>{this.dialog?.close()}}]})}},iris3:{id:"iris-dialog-a-3",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:"1006335",irisActions:[{anNo:3,onSelected:()=>{this.dialog?.close()}},{anNo:0,caption:"My custom IRIS action",description:"Custom IRIS action will change type of the trigger button",onSelected:()=>{this.exampleA.iris3.type=C.randomItem(["mat-flat-button","mat-button","mat-raised-button"])}}]})}},iris4:{id:"iris-dialog-a-4",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:"1006335",filterItems:[1,3]})}},iris5_1:{id:"iris-dialog-a-5-1",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:"1000000482"})}},iris5_2:{id:"iris-dialog-a-5-2",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:"1000000482",contentTags:{S0:"Moja hramba",S1:"Shrani dokument",S2:"Testna klasif.",S3:"Testna VD"}})}},iris6:{id:"iris-dialog-a-6",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisContent:{helpContext:1234,caption:"Custom message",description:"Custom IRIS description..."},irisActions:[{anNo:1,caption:"Custom IRIS item",description:"Custom IRIS item description",onSelected:()=>{console.log("Custom action")}}]})}}},this.exampleFull={iris1:{id:"iris-dialog-full-1",label:"Open IRIS",type:"mat-flat-button",onSelected:()=>{this.dialog=this.irisDialogService.open({irisId:"1000000482",contentTags:{S0:"Moja hramba",S1:"Shrani dokument",S2:"Testna klasif.",S3:"Testna VD"},filterItems:[10,20,30,50],irisActions:[{anNo:50,onSelected:()=>{this.dialog?.close()}},{anNo:11,caption:"My custom iris item",description:"Custom iris item",onSelected:()=>{}}]})}}}}ngOnDestroy(){this.dialog?.close()}static{this.\u0275fac=function(r){return new(r||l)(p(y))}}static{this.\u0275cmp=c({type:l,selectors:[["paw-sb-guide-iris"]],standalone:!1,decls:143,vars:13,consts:[[1,"p-4"],[1,"pl-4"],[1,"flex"],[1,"flex-[5]"],[1,"flex-[10]"],[3,"field","model"],[1,"flex-[2]","paw-offset-top-xs"],[3,"action"],[1,"flex-[7]","pr-4"],["disabled","","rows","20","disabled","",1,"w-full","sb-example-code"],[1,"pt-8"],[1,"paw-text-m"],[1,"flex","pt-4"],["disabled","","rows","8","disabled","",1,"sb-example-code"],["disabled","","rows","4","disabled","",1,"sb-example-code"],[1,"pt-4"],["disabled","","rows","12","disabled","",1,"sb-example-code"],["disabled","","rows","20","disabled","",1,"sb-example-code"],["disabled","","rows","6","disabled","",1,"sb-example-code"],["disabled","","rows","10","disabled","",1,"sb-example-code"]],template:function(r,n){r&1&&(t(0,"div",0)(1,"div",1)(2,"span"),e(3,"Preview IRIS (RAW)"),i()(),t(4,"div",2)(5,"div",3)(6,"div",2)(7,"div",4),s(8,"paw-input-field",5),i(),t(9,"div",6),s(10,"paw-action",7),i()()(),t(11,"div",8)(12,"div")(13,"span"),e(14,"IRIS RAW data:"),i()(),t(15,"textarea",9),e(16),g(17,"json"),i()()(),t(18,"div",10)(19,"span",11),e(20,"Open IRIS dialog"),i()(),t(21,"div",12)(22,"div",8)(23,"textarea",13),e(24,`private irisDialog:PawDialogRef;

...

this.irisDialog = this.irisDialogService.open({
    irisId: '1006335'
});
    `),i(),t(25,"p"),e(26,"Close IRIS Dialog in case dialog remains open."),i(),t(27,"textarea",14),e(28,`ngOnDestroy(){
    this.irisDialog?.close();
}
    `),i()(),t(29,"div",3),s(30,"paw-action",7),i()(),t(31,"div",15)(32,"span",11),e(33,"Assign actions to IRIS items"),i()(),t(34,"p"),e(35,"Assign actions with IRIS items via "),t(36,"code"),e(37,"anNo"),i(),e(38,"."),i(),t(39,"div",2)(40,"div",8)(41,"textarea",16),e(42,`this.irisDialog = this.irisDialogService.open({
    irisId: '1006335',
    irisActions: [
        {
            anNo: 3,
            onSelected: () => {
                this.irisDialog?.close(); // e.g. close
            },
        },
    ],
});
    `),i()(),t(43,"div",3),s(44,"paw-action",7),i()(),t(45,"div",15)(46,"span",11),e(47,"Add custom actions to IRIS dialog"),i()(),t(48,"p"),e(49," Specify own IRIS action. "),t(50,"code"),e(51,"anNo"),i(),e(52," in this case must not overflap any existing IRIS item "),t(53,"code"),e(54,"anNo"),i(),e(55,". "),t(56,"code"),e(57,"anNo"),i(),e(58," also defines the sort order of IRIS items. "),i(),t(59,"div",2)(60,"div",8)(61,"textarea",17),e(62,`this.irisDialog = this.irisDialogService.open({
    irisId: '1006335',
    irisActions: [
        {
            anNo: 3,
            onSelected: () => {
                this.irisDialog?.close(); // e.g. close
            },
            {
              anNo: 0,
              caption: 'My custom IRIS action',
              description:
                'Custom IRIS action will change type of the trigger button',
              onSelected: () => {
                ...
              },
            },
        },
    ],
});
    `),i(),t(63,"p"),e(64," If you want to override existing IRIS action, provide custom action with "),t(65,"code"),e(66,"anNo"),i(),e(67," that matches wanted IRIS action and provide own properties. "),i()(),t(68,"div",3),s(69,"paw-action",7),i()(),t(70,"div",15)(71,"span",11),e(72,"Filter IRIS items"),i()(),t(73,"p"),e(74," With "),t(75,"code"),e(76,"filterItems"),i(),e(77," we control the display of IRIS items - we say which we allow to display. The provided values correspond to item's "),t(78,"code"),e(79,"anNo"),i(),e(80,". "),i(),t(81,"p"),e(82," If we provide an empty array, none of the IRIS items would be displayed. "),i(),t(83,"div",2)(84,"div",8)(85,"textarea",18),e(86,`this.irisDialog = this.irisDialogService.open({
    irisId: '1006335',
    filterItems: [1, 3],
});
    `),i()(),t(87,"div",3),s(88,"paw-action",7),i()(),t(89,"div",15)(90,"span",11),e(91,"Content tags"),i()(),t(92,"p"),e(93,"In case IRIS content uses tags, we can populate those tags."),i(),t(94,"div",2)(95,"div",8)(96,"textarea",19),e(97,`this.irisDialog = this.irisDialogService.open({
    irisId: '1000000482',
    contentTags: {
        S0: 'Moja hramba',
        S1: 'Shrani dokument',
        S2: 'Testna klasif.',
        S3: 'Testna VD',
    }
});
    `),i(),t(98,"p"),e(99," In this example we have tags "),t(100,"code"),e(101,"S0"),i(),e(102,", "),t(103,"code"),e(104,"S1"),i(),e(105,", "),t(106,"code"),e(107,"S2"),i(),e(108,", "),t(109,"code"),e(110,"S3"),i(),e(111," in IRIS content. We replace them with corresponding value. "),i(),t(112,"p"),e(113," NOTE: tags are auto-translated, so you can provide only translation keys. "),i()(),t(114,"div",3)(115,"div")(116,"div")(117,"span"),e(118,"No content tags provided, will display tags."),i()(),s(119,"paw-action",7),i(),t(120,"div")(121,"div",15)(122,"span"),e(123,"Content tags populated"),i()(),s(124,"paw-action",7),i()()(),t(125,"div",15)(126,"span",11),e(127,"Custom IRIS dialog"),i()(),t(128,"p"),e(129," In case we need a fully custom IRIS dialog (content is not fetched from IRIS Web API), we can omit "),t(130,"code"),e(131,"irisId"),i(),e(132," and provide custom IRIS content via "),t(133,"code"),e(134,"irisContent"),i(),e(135,". "),i(),t(136,"div",2)(137,"div",8)(138,"textarea",19),e(139,`this.irisDialog = this.irisDialogService.open({
  irisContent: {
    helpContext: 1234,
    caption: 'Custom message',
    description: 'Custom IRIS description...',
  },
  irisActions: [
    {
      anNo: 1,
      caption: 'Custom IRIS item',
      description: 'Custom IRIS item description',
      onSelected: () => {
        console.log('Custom action');
      },
    },
  ],
});
    `),i()(),t(140,"div",3)(141,"div"),s(142,"paw-action",7),i()()()()),r&2&&(o(8),a("field",n.irisNumberField)("model",n.irisConfig),o(2),a("action",n.irisAction),o(6),I(x(17,11,n.irisRawPreview)),o(14),a("action",n.exampleA.iris1),o(14),a("action",n.exampleA.iris2),o(25),a("action",n.exampleA.iris3),o(19),a("action",n.exampleA.iris4),o(31),a("action",n.exampleA.iris5_1),o(5),a("action",n.exampleA.iris5_2),o(18),a("action",n.exampleA.iris6))},dependencies:[f,w,v],styles:["[_nghost-%COMP%]   .sb-example-podium[_ngcontent-%COMP%]{padding:16px;border:1px solid var(--paw-color-divider);border-radius:6px;background:var(--paw-color-content-bg);min-width:400px}[_nghost-%COMP%]   .sb-example-code[_ngcontent-%COMP%]{width:100%;resize:none;padding:4px}[_nghost-%COMP%]   .sb-example-outline[_ngcontent-%COMP%]{border:1px dashed var(--paw-color-divider)}[_nghost-%COMP%]   code[_ngcontent-%COMP%]{color:#8d0101;padding:4px;background:var(--paw-color-page-bg);border-radius:4px}"]})}}return l})();var z=(()=>{class l{static{this.\u0275fac=function(r){return new(r||l)}}static{this.\u0275mod=S({type:l})}static{this.\u0275inj=m({imports:[h,b,R,u.forChild([{path:"",component:D}])]})}}return l})();export{z as SbGuideIrisModule};
