@xplortech/apollo-core 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/build/style.css +282 -143
  3. package/dist/apollo-core/apollo-core.css +7 -3
  4. package/dist/apollo-core/apollo-core.esm.js +1 -1
  5. package/dist/apollo-core/{p-9b9511e4.entry.js → p-0203d4e8.entry.js} +1 -1
  6. package/dist/apollo-core/{p-eec5a0f1.entry.js → p-0b2c612e.entry.js} +1 -1
  7. package/dist/apollo-core/{p-63ea199d.entry.js → p-128a0240.entry.js} +1 -1
  8. package/dist/apollo-core/p-2336aa4c.entry.js +1 -0
  9. package/dist/apollo-core/{p-c6fec744.entry.js → p-30003b15.entry.js} +1 -1
  10. package/dist/apollo-core/p-4e56a2ca.entry.js +1 -0
  11. package/dist/apollo-core/{p-612984e5.entry.js → p-5854d1e4.entry.js} +1 -1
  12. package/dist/apollo-core/{p-6ad97405.entry.js → p-611536d8.entry.js} +1 -1
  13. package/dist/apollo-core/p-8b6633c7.js +1 -0
  14. package/dist/apollo-core/{p-650f6416.entry.js → p-97cd1f73.entry.js} +1 -1
  15. package/dist/apollo-core/p-9c5ca308.entry.js +1 -0
  16. package/dist/apollo-core/p-bd4a7e3c.entry.js +1 -0
  17. package/dist/apollo-core/{p-ed04cedd.entry.js → p-dab8e7a1.entry.js} +1 -1
  18. package/dist/apollo-core/{p-2c551f4d.entry.js → p-eb63b401.entry.js} +1 -1
  19. package/dist/apollo-core/{p-6081e432.entry.js → p-ee2f4422.entry.js} +1 -1
  20. package/dist/apollo-core/{p-f4f646d9.entry.js → p-f167aa05.entry.js} +1 -1
  21. package/dist/cjs/apollo-core.cjs.js +2 -2
  22. package/dist/cjs/{index-9662f096.js → index-944adb2e.js} +69 -1
  23. package/dist/cjs/loader.cjs.js +2 -2
  24. package/dist/cjs/xpl-application-shell_11.cjs.entry.js +232 -0
  25. package/dist/cjs/xpl-badge.cjs.entry.js +21 -0
  26. package/dist/cjs/xpl-button-row.cjs.entry.js +1 -1
  27. package/dist/cjs/xpl-checkbox_2.cjs.entry.js +51 -0
  28. package/dist/cjs/xpl-choicelist.cjs.entry.js +1 -1
  29. package/dist/cjs/xpl-divider.cjs.entry.js +1 -1
  30. package/dist/cjs/xpl-grid-item.cjs.entry.js +1 -1
  31. package/dist/cjs/xpl-grid.cjs.entry.js +1 -1
  32. package/dist/cjs/xpl-input.cjs.entry.js +1 -1
  33. package/dist/cjs/xpl-list.cjs.entry.js +1 -1
  34. package/dist/cjs/xpl-pagination.cjs.entry.js +1 -1
  35. package/dist/cjs/xpl-select.cjs.entry.js +1 -1
  36. package/dist/cjs/xpl-table.cjs.entry.js +89 -0
  37. package/dist/cjs/xpl-tag.cjs.entry.js +1 -1
  38. package/dist/cjs/xpl-toggle.cjs.entry.js +1 -1
  39. package/dist/collection/collection-manifest.json +1 -0
  40. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +145 -0
  41. package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +36 -2
  42. package/dist/collection/components/xpl-button/xpl-button.js +1 -1
  43. package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +34 -5
  44. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +63 -3
  45. package/dist/custom-elements/index.d.ts +6 -0
  46. package/dist/custom-elements/index.js +92 -8
  47. package/dist/esm/apollo-core.js +2 -2
  48. package/dist/esm/{index-619763f9.js → index-899dba3b.js} +69 -1
  49. package/dist/esm/loader.js +2 -2
  50. package/dist/esm/xpl-application-shell_11.entry.js +218 -0
  51. package/dist/esm/xpl-badge.entry.js +17 -0
  52. package/dist/esm/xpl-button-row.entry.js +1 -1
  53. package/dist/esm/xpl-checkbox_2.entry.js +46 -0
  54. package/dist/esm/xpl-choicelist.entry.js +1 -1
  55. package/dist/esm/xpl-divider.entry.js +1 -1
  56. package/dist/esm/xpl-grid-item.entry.js +1 -1
  57. package/dist/esm/xpl-grid.entry.js +1 -1
  58. package/dist/esm/xpl-input.entry.js +1 -1
  59. package/dist/esm/xpl-list.entry.js +1 -1
  60. package/dist/esm/xpl-pagination.entry.js +1 -1
  61. package/dist/esm/xpl-select.entry.js +1 -1
  62. package/dist/esm/xpl-table.entry.js +85 -0
  63. package/dist/esm/xpl-tag.entry.js +1 -1
  64. package/dist/esm/xpl-toggle.entry.js +1 -1
  65. package/dist/stories/application-shell.stories.js +766 -0
  66. package/dist/stories/main-nav.stories.js +1 -1
  67. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/application-shell.stories.d.ts +62 -0
  68. package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +24 -0
  69. package/dist/types/components/xpl-backdrop/xpl-backdrop.d.ts +5 -0
  70. package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +9 -0
  71. package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +12 -0
  72. package/dist/types/components.d.ts +61 -0
  73. package/package.json +1 -1
  74. package/dist/apollo-core/p-0027c582.entry.js +0 -1
  75. package/dist/apollo-core/p-ea8e0991.js +0 -1
  76. package/dist/cjs/xpl-avatar_14.cjs.entry.js +0 -293
  77. package/dist/esm/xpl-avatar_14.entry.js +0 -276
@@ -148,7 +148,7 @@ export const MainNav = ({ width }) => `
148
148
  </xpl-main-nav>
149
149
  `;
150
150
  const HtmlMainNav = ({ width }) => `
151
- <div class="xpl-main-nav xpl-main-nav__${width}">
151
+ <div class="xpl-main-nav xpl-main-nav--${width}">
152
152
  <nav aria-label="Sidebar">
153
153
  <header aria-label="Sidebar Header">
154
154
  <svg
@@ -0,0 +1,62 @@
1
+ declare const _default: {
2
+ title: string;
3
+ argTypes: {
4
+ navWidth: {
5
+ options: string[];
6
+ control: {
7
+ type: string;
8
+ };
9
+ };
10
+ showSecondaryNav: {
11
+ control: {
12
+ type: string;
13
+ };
14
+ };
15
+ showUtilityBar: {
16
+ control: {
17
+ type: string;
18
+ };
19
+ };
20
+ contentSize: {
21
+ options: string[];
22
+ control: {
23
+ type: string;
24
+ };
25
+ };
26
+ };
27
+ };
28
+ export default _default;
29
+ interface ApplicationShellProps {
30
+ navWidth: string;
31
+ showSecondaryNav: boolean;
32
+ showUtilityBar: boolean;
33
+ contentSize: string;
34
+ }
35
+ export declare const ApplicationShell: {
36
+ ({ navWidth, showSecondaryNav, showUtilityBar, contentSize }: ApplicationShellProps): string;
37
+ parameters: {
38
+ layout: string;
39
+ "web-component": {
40
+ render: ({ navWidth, showSecondaryNav, showUtilityBar, contentSize }: {
41
+ navWidth: any;
42
+ showSecondaryNav: any;
43
+ showUtilityBar: any;
44
+ contentSize: any;
45
+ }) => string;
46
+ };
47
+ html: {
48
+ render: ({ navWidth, showSecondaryNav, showUtilityBar, contentSize }: {
49
+ navWidth: any;
50
+ showSecondaryNav: any;
51
+ showUtilityBar: any;
52
+ contentSize: any;
53
+ }) => string;
54
+ };
55
+ };
56
+ args: {
57
+ navWidth: string;
58
+ showUtilityBar: boolean;
59
+ showSecondaryNav: boolean;
60
+ contentSize: string;
61
+ };
62
+ };
@@ -0,0 +1,24 @@
1
+ export declare class XplApplicationShell {
2
+ private closeNavOnMobile;
3
+ /**
4
+ * @property {boolean} - Whether or not the Grid should have space for a secondary (sub) navigation bar
5
+ */
6
+ withSubnav: boolean;
7
+ /**
8
+ * @property {boolean} - Whether or not the Grid should have space for a utility bar
9
+ */
10
+ withUtility: boolean;
11
+ /**
12
+ * @property {string} - The width of the main navigation bar, can be passed or updated when nav-width event is emitted.
13
+ */
14
+ navWidth: string;
15
+ /**
16
+ * @state {boolean} - Whether or not the main nav is open, updates when the nav-open envent is emitted.
17
+ */
18
+ navOpen: boolean;
19
+ navToggleHandler(): void;
20
+ navWithHandler(event: any): void;
21
+ onWindowResize(): void;
22
+ connectedCallback(): void;
23
+ render(): any;
24
+ }
@@ -1,3 +1,8 @@
1
1
  export declare class XplBackdrop {
2
+ /**
3
+ * @property {boolean} - When true, backdrop will have relative position. This is useful when the backdrop doesn't cover the whole view area.
4
+ * If false, the position will be fixed and cover the whole view area.
5
+ */
6
+ relative: boolean;
2
7
  render(): any;
3
8
  }
@@ -1,7 +1,16 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
1
2
  export declare class XplMainNav {
2
3
  /**
3
4
  * @property {string} width - The width of the Main Nav.
4
5
  */
5
6
  width: "default" | "md" | "sm";
7
+ /**
8
+ * @event {string} navWidth - Emits the `nav-width` prop set by the user
9
+ * when the component is attached to the DOM and when the component is updated.
10
+ */
11
+ navWidth: EventEmitter<string>;
12
+ private navWidthHandler;
13
+ connectedCallback(): void;
14
+ componentDidUpdate(): void;
6
15
  render(): any;
7
16
  }
@@ -1,3 +1,15 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
1
2
  export declare class XplUtilityBar {
3
+ /**
4
+ * @event {boolean} - Emits the desired state of the navigation bar (open: true/false)
5
+ */
6
+ navOpen: EventEmitter<boolean>;
7
+ /**
8
+ * @property {boolean} - whether or not to show the bars to control the state of the navigation bar (open/close)
9
+ */
10
+ navControl?: boolean;
11
+ open: boolean;
12
+ private onNavToggle;
13
+ private bars;
2
14
  render(): any;
3
15
  }
@@ -6,6 +6,20 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  export namespace Components {
9
+ interface XplApplicationShell {
10
+ /**
11
+ * @property {string} - The width of the main navigation bar, can be passed or updated when nav-width event is emitted.
12
+ */
13
+ "navWidth": string;
14
+ /**
15
+ * @property {boolean} - Whether or not the Grid should have space for a secondary (sub) navigation bar
16
+ */
17
+ "withSubnav": boolean;
18
+ /**
19
+ * @property {boolean} - Whether or not the Grid should have space for a utility bar
20
+ */
21
+ "withUtility": boolean;
22
+ }
9
23
  interface XplAvatar {
10
24
  "color"?: "green" | "yellow" | "pink" | "primary" | "secondary";
11
25
  "disabled"?: boolean;
@@ -17,6 +31,10 @@ export namespace Components {
17
31
  "target"?: string;
18
32
  }
19
33
  interface XplBackdrop {
34
+ /**
35
+ * @property {boolean} - When true, backdrop will have relative position. This is useful when the backdrop doesn't cover the whole view area. If false, the position will be fixed and cover the whole view area.
36
+ */
37
+ "relative": boolean;
20
38
  }
21
39
  interface XplBadge {
22
40
  "dot"?: boolean;
@@ -261,9 +279,19 @@ export namespace Components {
261
279
  "variant"?: "default" | "small";
262
280
  }
263
281
  interface XplUtilityBar {
282
+ /**
283
+ * @property {boolean} - whether or not to show the bars to control the state of the navigation bar (open/close)
284
+ */
285
+ "navControl"?: boolean;
264
286
  }
265
287
  }
266
288
  declare global {
289
+ interface HTMLXplApplicationShellElement extends Components.XplApplicationShell, HTMLStencilElement {
290
+ }
291
+ var HTMLXplApplicationShellElement: {
292
+ prototype: HTMLXplApplicationShellElement;
293
+ new (): HTMLXplApplicationShellElement;
294
+ };
267
295
  interface HTMLXplAvatarElement extends Components.XplAvatar, HTMLStencilElement {
268
296
  }
269
297
  var HTMLXplAvatarElement: {
@@ -415,6 +443,7 @@ declare global {
415
443
  new (): HTMLXplUtilityBarElement;
416
444
  };
417
445
  interface HTMLElementTagNameMap {
446
+ "xpl-application-shell": HTMLXplApplicationShellElement;
418
447
  "xpl-avatar": HTMLXplAvatarElement;
419
448
  "xpl-backdrop": HTMLXplBackdropElement;
420
449
  "xpl-badge": HTMLXplBadgeElement;
@@ -443,6 +472,20 @@ declare global {
443
472
  }
444
473
  }
445
474
  declare namespace LocalJSX {
475
+ interface XplApplicationShell {
476
+ /**
477
+ * @property {string} - The width of the main navigation bar, can be passed or updated when nav-width event is emitted.
478
+ */
479
+ "navWidth"?: string;
480
+ /**
481
+ * @property {boolean} - Whether or not the Grid should have space for a secondary (sub) navigation bar
482
+ */
483
+ "withSubnav"?: boolean;
484
+ /**
485
+ * @property {boolean} - Whether or not the Grid should have space for a utility bar
486
+ */
487
+ "withUtility"?: boolean;
488
+ }
446
489
  interface XplAvatar {
447
490
  "color"?: "green" | "yellow" | "pink" | "primary" | "secondary";
448
491
  "disabled"?: boolean;
@@ -454,6 +497,10 @@ declare namespace LocalJSX {
454
497
  "target"?: string;
455
498
  }
456
499
  interface XplBackdrop {
500
+ /**
501
+ * @property {boolean} - When true, backdrop will have relative position. This is useful when the backdrop doesn't cover the whole view area. If false, the position will be fixed and cover the whole view area.
502
+ */
503
+ "relative"?: boolean;
457
504
  }
458
505
  interface XplBadge {
459
506
  "dot"?: boolean;
@@ -630,6 +677,10 @@ declare namespace LocalJSX {
630
677
  "items"?: ListItem[];
631
678
  }
632
679
  interface XplMainNav {
680
+ /**
681
+ * @event {string} navWidth - Emits the `nav-width` prop set by the user when the component is attached to the DOM and when the component is updated.
682
+ */
683
+ "onNavWidth"?: (event: CustomEvent<string>) => void;
633
684
  /**
634
685
  * @property {string} width - The width of the Main Nav.
635
686
  */
@@ -716,8 +767,17 @@ declare namespace LocalJSX {
716
767
  "variant"?: "default" | "small";
717
768
  }
718
769
  interface XplUtilityBar {
770
+ /**
771
+ * @property {boolean} - whether or not to show the bars to control the state of the navigation bar (open/close)
772
+ */
773
+ "navControl"?: boolean;
774
+ /**
775
+ * @event {boolean} - Emits the desired state of the navigation bar (open: true/false)
776
+ */
777
+ "onNavOpen"?: (event: CustomEvent<boolean>) => void;
719
778
  }
720
779
  interface IntrinsicElements {
780
+ "xpl-application-shell": XplApplicationShell;
721
781
  "xpl-avatar": XplAvatar;
722
782
  "xpl-backdrop": XplBackdrop;
723
783
  "xpl-badge": XplBadge;
@@ -749,6 +809,7 @@ export { LocalJSX as JSX };
749
809
  declare module "@stencil/core" {
750
810
  export namespace JSX {
751
811
  interface IntrinsicElements {
812
+ "xpl-application-shell": LocalJSX.XplApplicationShell & JSXBase.HTMLAttributes<HTMLXplApplicationShellElement>;
752
813
  "xpl-avatar": LocalJSX.XplAvatar & JSXBase.HTMLAttributes<HTMLXplAvatarElement>;
753
814
  "xpl-backdrop": LocalJSX.XplBackdrop & JSXBase.HTMLAttributes<HTMLXplBackdropElement>;
754
815
  "xpl-badge": LocalJSX.XplBadge & JSXBase.HTMLAttributes<HTMLXplBadgeElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xplortech/apollo-core",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/custom-elements/index.js",
6
6
  "types": "dist/custom-elements/index.d.ts",
@@ -1 +0,0 @@
1
- import{r as t,h as s,H as l,c as i}from"./p-ea8e0991.js";import"./p-2f90296c.js";import{v as a}from"./p-ad90fe4d.js";const e=class{constructor(s){t(this,s),this.disabled=!1}render(){let t="xpl-avatar";this.size&&(t+=` xpl-avatar--${this.size}`),this.color&&(t+=` xpl-avatar--${this.color}`);const i=s("div",null,this.src?s("img",{alt:this.name,src:this.src}):s("div",{class:"xpl-avatar__placeholder"},s("slot",null)),this.status&&s("div",{class:`xpl-avatar__dot--${this.status}`}));return s(l,null,this.href&&!this.disabled?s("a",{href:this.href,class:t,target:this.target},i):s("div",this.href&&this.disabled?{class:t+" xpl-avatar--disabled"}:{class:t},i))}},r=class{constructor(s){t(this,s)}render(){return s(l,{class:"xpl-backdrop","aria-hidden":"true"})}},n=class{constructor(s){t(this,s)}render(){let t="xpl-badge";return this.dot&&(t+=" xpl-badge--dot"),this.variant&&(t+=" xpl-badge--"+this.variant),s(l,null,s("div",{class:t},s("slot",null)))}},h=class{constructor(s){t(this,s),this.chevron='<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" class="svg-inline--fa fa-chevron-right fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\n <path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path>\n </svg>\n '}render(){return s(l,{class:"xpl-breadcrumb-item",role:"listitem"},s("li",{role:"none"},s("slot",null)),s("span",{innerHTML:`${this.chevron}`}))}},o=class{constructor(s){t(this,s)}render(){return s(l,null,s("nav",{class:"xpl-breadcrumbs","aria-label":"Breadcrumb"},s("ol",{role:"list"},s("slot",null))))}},c=class{constructor(s){t(this,s),this.size="default",this.variant="primary"}render(){let t="xpl-button";"secondary"===this.variant&&(t+=" xpl-button--secondary"),"subtle"===this.variant&&(t+=" xpl-button--subtle"),"warning"===this.variant&&(t+=" xpl-button--warning"),"sm"===this.size&&(t+=" xpl-button--sm"),"xs"===this.size&&(t+=" xpl-button--xs"),this.iconOnly&&(t+=" xpl-button--icon-only");const i=this.icon?s("i",{class:`far fa-${this.icon} ${this.iconTrailing?"trailing":this.iconOnly?"":"leading"}`}):null;return s(l,null,this.href?s("a",{class:t,href:this.href,role:"button"},!this.iconTrailing&&i,this.iconOnly?s("span",{class:"sr-only"},s("slot",null)):s("slot",null),this.iconTrailing&&i):s("button",{class:t,disabled:this.disabled,name:this.name,type:this.type,value:this.value},!this.iconTrailing&&i,this.iconOnly?s("span",{class:"sr-only"},s("slot",null)):s("slot",null),this.iconTrailing&&i))}},d=class{constructor(s){t(this,s),this.checkboxChange=i(this,"checkboxChange",7),this.id=a()}render(){return s(l,{class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},s("input",{class:"xpl-checkbox",type:"checkbox",checked:this.checked,disabled:this.disabled,id:this.id,indeterminate:this.indeterminate,onChange:()=>this.checkboxChange.emit(this.input.checked),name:this.name,ref:t=>this.input=t,required:this.required,value:this.value}),s("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},s("slot",null),this.description&&s("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)))}},p=class{constructor(s){t(this,s),this.size="wide"}render(){return s(l,null,s("main",{class:`xpl-content-area-wrapper xpl-content-area-wrapper__${this.size}`},s("div",{class:"xpl-content-area"},s("slot",null))))}},u=class{constructor(s){t(this,s),this.width="default"}render(){return s(l,{class:`xpl-main-nav xpl-main-nav__${this.width}`,"aria-label":"Sidebar"},s("nav",null,s("header",{"aria-label":"Sidebar Header"},s("slot",{name:"logo"}),s("slot",{name:"brand-name"})),s("slot",{name:"navigation"})),s("footer",{class:"xpl-main-nav-footer","aria-label":"Sidebar Footer"},s("slot",{name:"footer"})))}},b=class{constructor(s){t(this,s)}render(){return s(l,{class:"xpl-nav-item",role:"listitem"},s("slot",{name:"link"},s("slot",{name:"icon"}),s("slot",null)))}},x=class{constructor(s){t(this,s),this.radioChange=i(this,"radioChange",7),this.id=a()}render(){return s(l,{class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},s("input",{class:"xpl-radio",type:"radio",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,value:this.value,onChange:()=>this.radioChange.emit(!0)}),s("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},s("slot",null),this.description&&s("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)))}},m=class{constructor(s){t(this,s)}render(){return s(l,{class:"xpl-secondary-nav"},s("nav",{"aria-label":"Secondary Nav"},s("slot",null)))}},v=class{constructor(s){t(this,s),this.tableSelect=i(this,"tableSelect",7),this.areAllSelected=!1,this.hasScrolled=!1,this.selectAll=t=>{const{target:s}=t;if(!(s instanceof HTMLInputElement))return;const{checked:l}=s;this.areAllSelected=l,this.selected=this.selected.map((()=>l)),this.onChange()},this.selectOne=(t,s)=>{const{target:l}=t;if(!(l instanceof HTMLInputElement))return;const{checked:i}=l;this.areAllSelected=!1,this.selected=this.selected.map(((t,l)=>l===s?i:t)),this.onChange()},this.onChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})},this.onScroll=()=>{this.hasScrolled=this.container.scrollLeft>0},this.sortBy=(t,s=!0)=>{this.rowData.sort(((l,i)=>{const a=l[t],e=i[t];if("number"==typeof a&&"number"==typeof e){const t=s?1:-1;return a>e?t:-t}return-1})),this.rowData=Array.from(this.rowData),this.render()}}componentWillLoad(){this.areAllSelected=!1,this.rowData=void 0!==this.data?Array.from(this.data):[],this.selected=new Array(this.rowData.length).fill(!1)}render(){let t="xpl-table";return this.striped&&(t+=" xpl-table--striped"),this.freeze&&(t+=" xpl-table--freeze"),this.hasScrolled&&(t+=" xpl-table--has-scrolled"),s(l,null,s("div",{class:"xpl-table-container",onScroll:this.onScroll,ref:t=>this.container=t},s("table",{class:t},this.columns&&s("thead",null,this.columns.map(((t,l)=>s("th",null,this.multiselect&&0===l?s("label",{htmlFor:"__xpl-table-th"},s("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some((t=>t)),onChange:t=>{this.selectAll(t)},type:"checkbox"}),t):t)))),s("tbody",null,this.rowData.map(((t,l)=>s("tr",{class:this.selected&&this.selected[l]?"xpl-table-row-selected":""},t.map(((t,i)=>s("td",null,this.multiselect&&0===i?s("label",{htmlFor:"__xpl-table-row-"+l},s("input",{id:"__xpl-table-row-"+l,checked:this.selected[l],type:"checkbox",onChange:t=>this.selectOne(t,l)}),s("div",{innerHTML:t})):s("div",{innerHTML:t})))))))))))}},_=class{constructor(s){t(this,s)}render(){return s(l,null,s("nav",{"aria-label":"utility navigation bar",class:"xpl-utility-bar"},s("slot",{name:"main"}),s("slot",{name:"aside"})))}};export{e as xpl_avatar,r as xpl_backdrop,n as xpl_badge,h as xpl_breadcrumb_item,o as xpl_breadcrumbs,c as xpl_button,d as xpl_checkbox,p as xpl_content_area,u as xpl_main_nav,b as xpl_nav_item,x as xpl_radio,m as xpl_secondary_nav,v as xpl_table,_ as xpl_utility_bar}
@@ -1 +0,0 @@
1
- let e,t,l=!1,n=!1,o=!1,s=!1,i=!1;const r="undefined"!=typeof window?window:{},c=r.document||{head:{}},f={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,l,n)=>e.addEventListener(t,l,n),rel:(e,t,l,n)=>e.removeEventListener(t,l,n),ce:(e,t)=>new CustomEvent(e,t)},a=e=>Promise.resolve(e),u="http://www.w3.org/1999/xlink",$={},d=e=>"object"==(e=typeof e)||"function"===e,b=(e,t,...l)=>{let n=null,o=null,s=null,i=!1,r=!1,c=[];const f=t=>{for(let l=0;l<t.length;l++)n=t[l],Array.isArray(n)?f(n):null!=n&&"boolean"!=typeof n&&((i="function"!=typeof e&&!d(n))&&(n+=""),i&&r?c[c.length-1].o+=n:c.push(i?m(null,n):n),r=i)};if(f(l),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,c,h);const a=m(e,null);return a.i=t,c.length>0&&(a.u=c),a.$=o,a.m=s,a},m=(e,t)=>({t:0,p:e,o:t,h:null,u:null,i:null,$:null,m:null}),p={},h={forEach:(e,t)=>e.map(y).forEach(t),map:(e,t)=>e.map(y).map(t).map(w)},y=e=>({vattrs:e.i,vchildren:e.u,vkey:e.$,vname:e.m,vtag:e.p,vtext:e.o}),w=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),b(e.vtag,t,...e.vchildren||[])}const t=m(e.vtag,e.vtext);return t.i=e.vattrs,t.u=e.vchildren,t.$=e.vkey,t.m=e.vname,t},g=(e,t,l,n,o,s)=>{if(l!==n){let i=oe(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=j(l),s=j(n);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in l)n&&null!=n[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in n)l&&n[t]===l[t]||(t.includes("-")?e.style.setProperty(t,n[t]):e.style[t]=n[t])}else if("key"===t);else if("ref"===t)n&&n(e);else if(i||"o"!==t[0]||"n"!==t[1]){const r=d(n);if((i||r&&null!==n)&&!o)try{if(e.tagName.includes("-"))e[t]=n;else{let o=null==n?"":n;"list"===t?i=!1:null!=l&&e[t]==o||(e[t]=o)}}catch(e){}let f=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,f=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(t)||(f?e.removeAttributeNS(u,t):e.removeAttribute(t)):(!i||4&s||o)&&!r&&(n=!0===n?"":n,f?e.setAttributeNS(u,t,n):e.setAttribute(t,n))}else t="-"===t[2]?t.slice(3):oe(r,c)?c.slice(2):c[2]+t.slice(3),l&&f.rel(e,t,l,!1),n&&f.ael(e,t,n,!1)}},v=/\s/,j=e=>e?e.split(v):[],k=(e,t,l,n)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,s=e&&e.i||$,i=t.i||$;for(n in s)n in i||g(o,n,s[n],void 0,l,t.t);for(n in i)g(o,n,s[n],i[n],l,t.t)},O=(n,i,r)=>{let f,a,u,$=i.u[r],d=0;if(l||(o=!0,"slot"===$.p&&($.t|=$.u?2:1)),null!==$.o)f=$.h=c.createTextNode($.o);else if(1&$.t)f=$.h=c.createTextNode("");else{if(s||(s="svg"===$.p),f=$.h=c.createElementNS(s?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&$.t?"slot-fb":$.p),s&&"foreignObject"===$.p&&(s=!1),k(null,$,s),$.u)for(d=0;d<$.u.length;++d)a=O(n,$,d),a&&f.appendChild(a);"svg"===$.p?s=!1:"foreignObject"===f.tagName&&(s=!0)}return f["s-hn"]=t,3&$.t&&(f["s-sr"]=!0,f["s-cr"]=e,f["s-sn"]=$.m||"",u=n&&n.u&&n.u[r],u&&u.p===$.p&&n.h&&x(n.h,!1)),f},x=(e,l)=>{f.t|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const s=n[e];s["s-hn"]!==t&&s["s-ol"]&&(E(s).insertBefore(s,T(s)),s["s-ol"].remove(),s["s-ol"]=void 0,o=!0),l&&x(s,l)}f.t&=-2},M=(e,t,l,n,o,s)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(;o<=s;++o)n[o]&&(i=O(null,l,o),i&&(n[o].h=i,r.insertBefore(i,T(t))))},P=(e,t,l,o,s)=>{for(;t<=l;++t)(o=e[t])&&(s=o.h,N(o),n=!0,s["s-ol"]?s["s-ol"].remove():x(s,!0),s.remove())},R=(e,t)=>e.p===t.p&&("slot"===e.p?e.m===t.m:e.$===t.$),T=e=>e&&e["s-ol"]||e,E=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,L=(e,t)=>{const l=t.h=e.h,n=e.u,o=t.u,i=t.p,r=t.o;let c;null===r?(s="svg"===i||"foreignObject"!==i&&s,"slot"===i||k(e,t,s),null!==n&&null!==o?((e,t,l,n)=>{let o,s,i=0,r=0,c=0,f=0,a=t.length-1,u=t[0],$=t[a],d=n.length-1,b=n[0],m=n[d];for(;i<=a&&r<=d;)if(null==u)u=t[++i];else if(null==$)$=t[--a];else if(null==b)b=n[++r];else if(null==m)m=n[--d];else if(R(u,b))L(u,b),u=t[++i],b=n[++r];else if(R($,m))L($,m),$=t[--a],m=n[--d];else if(R(u,m))"slot"!==u.p&&"slot"!==m.p||x(u.h.parentNode,!1),L(u,m),e.insertBefore(u.h,$.h.nextSibling),u=t[++i],m=n[--d];else if(R($,b))"slot"!==u.p&&"slot"!==m.p||x($.h.parentNode,!1),L($,b),e.insertBefore($.h,u.h),$=t[--a],b=n[++r];else{for(c=-1,f=i;f<=a;++f)if(t[f]&&null!==t[f].$&&t[f].$===b.$){c=f;break}c>=0?(s=t[c],s.p!==b.p?o=O(t&&t[r],l,c):(L(s,b),t[c]=void 0,o=s.h),b=n[++r]):(o=O(t&&t[r],l,r),b=n[++r]),o&&E(u.h).insertBefore(o,T(u.h))}i>a?M(e,null==n[d+1]?null:n[d+1].h,l,n,r,d):r>d&&P(t,i,a)})(l,n,t,o):null!==o?(null!==e.o&&(l.textContent=""),M(l,null,t,o,0,o.length-1)):null!==n&&P(n,0,n.length-1),s&&"svg"===i&&(s=!1)):(c=l["s-cr"])?c.parentNode.textContent=r:e.o!==r&&(l.data=r)},C=e=>{let t,l,n,o,s,i,r=e.childNodes;for(l=0,n=r.length;l<n;l++)if(t=r[l],1===t.nodeType){if(t["s-sr"])for(s=t["s-sn"],t.hidden=!1,o=0;o<n;o++)if(i=r[o].nodeType,r[o]["s-hn"]!==t["s-hn"]||""!==s){if(1===i&&s===r[o].getAttribute("slot")){t.hidden=!0;break}}else if(1===i||3===i&&""!==r[o].textContent.trim()){t.hidden=!0;break}C(t)}},F=[],A=e=>{let t,l,o,s,i,r,c=0,f=e.childNodes,a=f.length;for(;c<a;c++){if(t=f[c],t["s-sr"]&&(l=t["s-cr"])&&l.parentNode)for(o=l.parentNode.childNodes,s=t["s-sn"],r=o.length-1;r>=0;r--)l=o[r],l["s-cn"]||l["s-nr"]||l["s-hn"]===t["s-hn"]||(H(l,s)?(i=F.find((e=>e.g===l)),n=!0,l["s-sn"]=l["s-sn"]||s,i?i.v=t:F.push({v:t,g:l}),l["s-sr"]&&F.map((e=>{H(e.g,l["s-sn"])&&(i=F.find((e=>e.g===l)),i&&!e.v&&(e.v=i.v))}))):F.some((e=>e.g===l))||F.push({g:l}));1===t.nodeType&&A(t)}},H=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,N=e=>{e.i&&e.i.ref&&e.i.ref(null),e.u&&e.u.map(N)},U=e=>te(e).j,W=(e,t,l)=>{const n=U(e);return{emit:e=>q(n,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},q=(e,t,l)=>{const n=f.ce(t,l);return e.dispatchEvent(n),n},D=(e,t)=>{t&&!e.k&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.k=t)))},V=(e,t)=>{if(e.t|=16,!(4&e.t))return D(e,e.O),be((()=>_(e,t)));e.t|=512},_=(e,t)=>{const l=e.M;let n;return t&&(n=J(l,"componentWillLoad")),K(n,(()=>z(e,l)))},z=async(e,t)=>{const l=e.j,n=l["s-rc"];B(e,t),n&&(n.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>G(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},B=(s,i)=>{try{i=i.render(),s.t&=-17,s.t|=2,((s,i)=>{const r=s.j,a=s.P,u=s.R||m(null,null),$=(e=>e&&e.p===p)(i)?i:b(null,null,i);if(t=r.tagName,$.p=null,$.t|=4,s.R=$,$.h=u.h=r,e=r["s-cr"],l=0!=(1&a.t),n=!1,L(u,$),f.t|=1,o){let e,t,l,n,o,s;A($.h);let i=0;for(;i<F.length;i++)e=F[i],t=e.g,t["s-ol"]||(l=c.createTextNode(""),l["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=l,t));for(i=0;i<F.length;i++)if(e=F[i],t=e.g,e.v){for(n=e.v.parentNode,o=e.v.nextSibling,l=t["s-ol"];l=l.previousSibling;)if(s=l["s-nr"],s&&s["s-sn"]===t["s-sn"]&&n===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&n!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),n.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}n&&C($.h),f.t&=-2,F.length=0})(s,i)}catch(e){se(e,s.j)}return null},G=e=>{const t=e.j,l=e.M,n=e.O;64&e.t||(e.t|=64,Q(t),J(l,"componentDidLoad"),e.T(t),n||I()),e.L(t),e.k&&(e.k(),e.k=void 0),512&e.t&&de((()=>V(e,!1))),e.t&=-517},I=()=>{Q(c.documentElement),de((()=>q(r,"appload",{detail:{namespace:"apollo-core"}})))},J=(e,t,l)=>{if(e&&e[t])try{return e[t](l)}catch(e){se(e)}},K=(e,t)=>e&&e.then?e.then(t):t(),Q=e=>e.classList.add("hydrated"),S=(e,t,l)=>{if(t.C){const n=Object.entries(t.C),o=e.prototype;if(n.map((([e,[n]])=>{31&n||2&l&&32&n?Object.defineProperty(o,e,{get(){return((e,t)=>te(this).F.get(t))(0,e)},set(l){((e,t,l,n)=>{const o=te(e),s=o.F.get(t),i=o.t,r=o.M;l=((e,t)=>null==e||d(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,n.C[t][0]),8&i&&void 0!==s||l===s||(o.F.set(t,l),r&&2==(18&i)&&V(o,!1))})(this,e,l,t)},configurable:!0,enumerable:!0}):1&l&&64&n&&Object.defineProperty(o,e,{value(...t){const l=te(this);return l.A.then((()=>l.M[e](...t)))}})})),1&l){const t=new Map;o.attributeChangedCallback=function(e,l,n){f.jmp((()=>{const l=t.get(e);this.hasOwnProperty(l)&&(n=this[l],delete this[l]),this[l]=(null!==n||"boolean"!=typeof this[l])&&n}))},e.observedAttributes=n.filter((([e,t])=>15&t[0])).map((([e,l])=>{const n=l[1]||e;return t.set(n,e),n}))}}return e},X=e=>{const t=e["s-cr"]=c.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},Y=(e,t={})=>{const l=[],n=t.exclude||[],o=r.customElements,s=c.head,i=s.querySelector("meta[charset]"),a=c.createElement("style"),u=[];let $,d=!0;Object.assign(f,t),f.l=new URL(t.resourcesUrl||"./",c.baseURI).href,e.map((e=>e[1].map((t=>{const s={t:t[0],H:t[1],C:t[2],N:t[3]};s.C=t[2];const i=s.H,r=class extends HTMLElement{constructor(e){super(e),ne(e=this,s)}connectedCallback(){$&&(clearTimeout($),$=null),d?u.push(this):f.jmp((()=>(e=>{if(0==(1&f.t)){const t=te(e),l=t.P,n=()=>{};if(!(1&t.t)){t.t|=1,12&l.t&&X(e);{let l=e;for(;l=l.parentNode||l.host;)if(l["s-p"]){D(t,t.O=l);break}}l.C&&Object.entries(l.C).map((([t,[l]])=>{if(31&l&&e.hasOwnProperty(t)){const l=e[t];delete e[t],e[t]=l}})),(async(e,t,l,n,o)=>{if(0==(32&t.t)){if(t.t|=32,(o=re(l)).then){const e=()=>{};o=await o,e()}o.isProxied||(S(o,l,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){se(e)}t.t&=-9,e()}const s=t.O,i=()=>V(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,l)}n()}})(this)))}disconnectedCallback(){f.jmp((()=>{}))}componentOnReady(){return te(this).U}};s.W=e[0],n.includes(i)||o.get(i)||(l.push(i),o.define(i,S(r,s,1)))})))),a.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",a.setAttribute("data-styles",""),s.insertBefore(a,i?i.nextSibling:s.firstChild),d=!1,u.length?u.map((e=>e.connectedCallback())):f.jmp((()=>$=setTimeout(I,30)))},Z=(e,t)=>t,ee=new WeakMap,te=e=>ee.get(e),le=(e,t)=>ee.set(t.M=e,t),ne=(e,t)=>{const l={t:0,j:e,P:t,F:new Map};return l.A=new Promise((e=>l.L=e)),l.U=new Promise((e=>l.T=e)),e["s-p"]=[],e["s-rc"]=[],ee.set(e,l)},oe=(e,t)=>t in e,se=(e,t)=>(0,console.error)(e,t),ie=new Map,re=e=>{const t=e.H.replace(/-/g,"_"),l=e.W,n=ie.get(l);return n?n[t]:import(`./${l}.entry.js`).then((e=>(ie.set(l,e),e[t])),se)},ce=[],fe=[],ae=(e,t)=>l=>{e.push(l),i||(i=!0,t&&4&f.t?de($e):f.raf($e))},ue=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){se(e)}e.length=0},$e=()=>{ue(ce),ue(fe),(i=ce.length>0)&&f.raf($e)},de=e=>a().then(e),be=ae(fe,!0);export{Z as F,p as H,Y as b,W as c,U as g,b as h,a as p,le as r}
@@ -1,293 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-9662f096.js');
6
- require('./regular-872f5226.js');
7
- const v4 = require('./v4-14140ff3.js');
8
-
9
- const XplAvatar = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.disabled = false;
13
- }
14
- render() {
15
- let className = "xpl-avatar";
16
- if (this.size)
17
- className += ` xpl-avatar--${this.size}`;
18
- if (this.color)
19
- className += ` xpl-avatar--${this.color}`;
20
- const inner = (index.h("div", null, this.src ? (index.h("img", { alt: this.name, src: this.src })) : (index.h("div", { class: "xpl-avatar__placeholder" }, index.h("slot", null))), this.status && index.h("div", { class: `xpl-avatar__dot--${this.status}` })));
21
- return (index.h(index.Host, null, this.href && !this.disabled ? (index.h("a", { href: this.href, class: className, target: this.target }, inner)) : this.href && this.disabled ? (index.h("div", { class: className + " xpl-avatar--disabled" }, inner)) : (index.h("div", { class: className }, inner))));
22
- }
23
- };
24
-
25
- const XplBackdrop = class {
26
- constructor(hostRef) {
27
- index.registerInstance(this, hostRef);
28
- }
29
- render() {
30
- return (index.h(index.Host, { class: "xpl-backdrop", "aria-hidden": "true" }));
31
- }
32
- };
33
-
34
- const XplBadge = class {
35
- constructor(hostRef) {
36
- index.registerInstance(this, hostRef);
37
- }
38
- render() {
39
- let className = "xpl-badge";
40
- if (this.dot)
41
- className += " xpl-badge--dot";
42
- if (this.variant)
43
- className += " xpl-badge--" + this.variant;
44
- return (index.h(index.Host, null, index.h("div", { class: className }, index.h("slot", null))));
45
- }
46
- };
47
-
48
- const XplBreadcrumbItem = class {
49
- constructor(hostRef) {
50
- index.registerInstance(this, hostRef);
51
- // This is temporary as we still don't have a xpl-icon component. When that's created we should update this code.
52
- this.chevron = `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" class="svg-inline--fa fa-chevron-right fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
53
- <path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path>
54
- </svg>
55
- `;
56
- }
57
- render() {
58
- return (index.h(index.Host, { class: "xpl-breadcrumb-item", role: "listitem" }, index.h("li", { role: "none" }, index.h("slot", null)), index.h("span", { innerHTML: `${this.chevron}` })));
59
- }
60
- ;
61
- };
62
-
63
- const XplBreadcrumbs = class {
64
- constructor(hostRef) {
65
- index.registerInstance(this, hostRef);
66
- }
67
- render() {
68
- return (index.h(index.Host, null, index.h("nav", { class: "xpl-breadcrumbs", "aria-label": "Breadcrumb" }, index.h("ol", { role: "list" }, index.h("slot", null)))));
69
- }
70
- ;
71
- };
72
-
73
- const XplButton = class {
74
- constructor(hostRef) {
75
- index.registerInstance(this, hostRef);
76
- this.size = "default";
77
- this.variant = "primary";
78
- }
79
- render() {
80
- let className = "xpl-button";
81
- if (this.variant === "secondary")
82
- className += " xpl-button--secondary";
83
- if (this.variant === "subtle")
84
- className += " xpl-button--subtle";
85
- if (this.variant === "warning")
86
- className += " xpl-button--warning";
87
- if (this.size === "sm")
88
- className += " xpl-button--sm";
89
- if (this.size === "xs")
90
- className += " xpl-button--xs";
91
- if (this.iconOnly)
92
- className += " xpl-button--icon-only";
93
- const icon = this.icon ? (index.h("i", { class: `far fa-${this.icon} ${this.iconTrailing ? "trailing" : this.iconOnly ? "" : "leading"}` })) : null;
94
- return (index.h(index.Host, null,
95
- /**
96
- * Conditionally render either an <a> or <button> element
97
- * depending on if there's an `href` or not
98
- */
99
- this.href ? (index.h("a", { class: className, href: this.href, role: "button" }, !this.iconTrailing && icon, this.iconOnly ? (index.h("span", { class: "sr-only" }, index.h("slot", null))) : (index.h("slot", null)), this.iconTrailing && icon)) : (index.h("button", { class: className, disabled: this.disabled, name: this.name, type: this.type, value: this.value }, !this.iconTrailing && icon, this.iconOnly ? (index.h("span", { class: "sr-only" }, index.h("slot", null))) : (index.h("slot", null)), this.iconTrailing && icon))));
100
- }
101
- };
102
-
103
- const XplCheckbox = class {
104
- constructor(hostRef) {
105
- index.registerInstance(this, hostRef);
106
- this.checkboxChange = index.createEvent(this, "checkboxChange", 7);
107
- this.id = v4.v4();
108
- }
109
- render() {
110
- return (index.h(index.Host, { class: {
111
- "xpl-checkbox-radio-container": true,
112
- "styled": this.styled,
113
- "disabled": this.disabled,
114
- } }, index.h("input", { class: "xpl-checkbox", type: "checkbox", checked: this.checked, disabled: this.disabled, id: this.id, indeterminate: this.indeterminate, onChange: () => this.checkboxChange.emit(this.input.checked), name: this.name, ref: (el) => (this.input = el), required: this.required, value: this.value }), index.h("label", { class: {
115
- "xpl-label": true,
116
- "xpl-label--disabled": this.disabled
117
- }, htmlFor: this.id }, index.h("slot", null), this.description && index.h("small", { class: {
118
- "xpl-description": true,
119
- "xpl-description--disabled": this.disabled
120
- } }, this.description))));
121
- }
122
- };
123
-
124
- const XplContentArea = class {
125
- constructor(hostRef) {
126
- index.registerInstance(this, hostRef);
127
- /**
128
- * @property {string} size - The content-area size.
129
- */
130
- this.size = "wide";
131
- }
132
- render() {
133
- return (index.h(index.Host, null, index.h("main", { class: `xpl-content-area-wrapper xpl-content-area-wrapper__${this.size}` }, index.h("div", { class: "xpl-content-area" }, index.h("slot", null)))));
134
- }
135
- };
136
-
137
- const XplMainNav = class {
138
- constructor(hostRef) {
139
- index.registerInstance(this, hostRef);
140
- /**
141
- * @property {string} width - The width of the Main Nav.
142
- */
143
- this.width = "default";
144
- }
145
- render() {
146
- return (index.h(index.Host, { class: `xpl-main-nav xpl-main-nav__${this.width}`, "aria-label": "Sidebar" }, index.h("nav", null, index.h("header", { "aria-label": "Sidebar Header" }, index.h("slot", { name: "logo" }), index.h("slot", { name: "brand-name" })), index.h("slot", { name: "navigation" })), index.h("footer", { class: "xpl-main-nav-footer", "aria-label": "Sidebar Footer" }, index.h("slot", { name: "footer" }))));
147
- }
148
- };
149
-
150
- const XplNavItem = class {
151
- constructor(hostRef) {
152
- index.registerInstance(this, hostRef);
153
- }
154
- render() {
155
- return (index.h(index.Host, { class: "xpl-nav-item", role: "listitem" }, index.h("slot", { name: "link" }, index.h("slot", { name: "icon" }), index.h("slot", null))));
156
- }
157
- };
158
-
159
- const XplRadio = class {
160
- constructor(hostRef) {
161
- index.registerInstance(this, hostRef);
162
- this.radioChange = index.createEvent(this, "radioChange", 7);
163
- this.id = v4.v4();
164
- }
165
- render() {
166
- return (index.h(index.Host, { class: {
167
- "xpl-checkbox-radio-container": true,
168
- "styled": this.styled,
169
- "disabled": this.disabled,
170
- } }, index.h("input", { class: "xpl-radio", type: "radio", checked: this.checked, disabled: this.disabled, id: this.id, name: this.name, required: this.required, value: this.value, onChange: () => this.radioChange.emit(true) }), index.h("label", { class: {
171
- "xpl-label": true,
172
- "xpl-label--disabled": this.disabled
173
- }, htmlFor: this.id }, index.h("slot", null), this.description && index.h("small", { class: {
174
- "xpl-description": true,
175
- "xpl-description--disabled": this.disabled
176
- } }, this.description))));
177
- }
178
- };
179
-
180
- const XplSecondaryNav = class {
181
- constructor(hostRef) {
182
- index.registerInstance(this, hostRef);
183
- }
184
- render() {
185
- return (index.h(index.Host, { class: "xpl-secondary-nav" }, index.h("nav", { "aria-label": "Secondary Nav" }, index.h("slot", null))));
186
- }
187
- };
188
-
189
- const XplTable = class {
190
- constructor(hostRef) {
191
- index.registerInstance(this, hostRef);
192
- this.tableSelect = index.createEvent(this, "tableSelect", 7);
193
- this.areAllSelected = false;
194
- this.hasScrolled = false;
195
- this.selectAll = (e) => {
196
- const { target } = e;
197
- if (!(target instanceof HTMLInputElement))
198
- return;
199
- const { checked } = target;
200
- this.areAllSelected = checked;
201
- this.selected = this.selected.map(() => checked);
202
- this.onChange();
203
- };
204
- this.selectOne = (e, i) => {
205
- const { target } = e;
206
- if (!(target instanceof HTMLInputElement))
207
- return;
208
- const { checked } = target;
209
- this.areAllSelected = false;
210
- this.selected = this.selected.map((v, _i) => (_i === i ? checked : v));
211
- this.onChange();
212
- };
213
- this.onChange = () => {
214
- this.tableSelect.emit({
215
- selected: this.selected,
216
- areAllSelected: this.areAllSelected,
217
- });
218
- };
219
- this.onScroll = () => {
220
- this.hasScrolled = this.container.scrollLeft > 0;
221
- };
222
- /**
223
- * TODO: Need to figure out how this interplays with data
224
- * received from an API/server
225
- */
226
- this.sortBy = (col, ascending = true) => {
227
- this.rowData.sort((a, b) => {
228
- const A = a[col];
229
- const B = b[col];
230
- if (typeof A === "number" && typeof B === "number") {
231
- const f = ascending ? 1 : -1;
232
- return A > B ? f : -f;
233
- }
234
- return -1;
235
- });
236
- this.rowData = Array.from(this.rowData);
237
- this.render();
238
- };
239
- }
240
- componentWillLoad() {
241
- this.areAllSelected = false;
242
- this.rowData = this.data !== undefined ? Array.from(this.data) : [];
243
- this.selected = new Array(this.rowData.length).fill(false);
244
- }
245
- render() {
246
- let className = "xpl-table";
247
- if (this.striped)
248
- className += " xpl-table--striped";
249
- if (this.freeze)
250
- className += " xpl-table--freeze";
251
- if (this.hasScrolled)
252
- className += " xpl-table--has-scrolled";
253
- return (index.h(index.Host, null, index.h("div", { class: "xpl-table-container", onScroll: this.onScroll, ref: (el) => (this.container = el) }, index.h("table", { class: className }, this.columns && (index.h("thead", null, this.columns.map((column, i) => {
254
- return (index.h("th", null, this.multiselect && i === 0 ? (index.h("label", { htmlFor: "__xpl-table-th" }, index.h("input", { checked: this.areAllSelected, id: "__xpl-table-th",
255
- // appear indeterminate when at least one but not all
256
- // are selected
257
- indeterminate: !this.areAllSelected &&
258
- this.selected.some((a) => a), onChange: (e) => {
259
- this.selectAll(e);
260
- }, type: "checkbox" }), column)) : (column)));
261
- }))), index.h("tbody", null, this.rowData.map((row, rowNum) => {
262
- return (index.h("tr", { class: this.selected && this.selected[rowNum]
263
- ? "xpl-table-row-selected"
264
- : "" }, row.map((cell, i) => {
265
- return (index.h("td", null, this.multiselect && i === 0 ? (index.h("label", { htmlFor: "__xpl-table-row-" + rowNum }, index.h("input", { id: "__xpl-table-row-" + rowNum, checked: this.selected[rowNum], type: "checkbox", onChange: (e) => this.selectOne(e, rowNum) }), index.h("div", { innerHTML: cell }))) : (index.h("div", { innerHTML: cell }))));
266
- })));
267
- }))))));
268
- }
269
- };
270
-
271
- const XplUtilityBar = class {
272
- constructor(hostRef) {
273
- index.registerInstance(this, hostRef);
274
- }
275
- render() {
276
- return (index.h(index.Host, null, index.h("nav", { "aria-label": "utility navigation bar", class: "xpl-utility-bar" }, index.h("slot", { name: "main" }), index.h("slot", { name: "aside" }))));
277
- }
278
- };
279
-
280
- exports.xpl_avatar = XplAvatar;
281
- exports.xpl_backdrop = XplBackdrop;
282
- exports.xpl_badge = XplBadge;
283
- exports.xpl_breadcrumb_item = XplBreadcrumbItem;
284
- exports.xpl_breadcrumbs = XplBreadcrumbs;
285
- exports.xpl_button = XplButton;
286
- exports.xpl_checkbox = XplCheckbox;
287
- exports.xpl_content_area = XplContentArea;
288
- exports.xpl_main_nav = XplMainNav;
289
- exports.xpl_nav_item = XplNavItem;
290
- exports.xpl_radio = XplRadio;
291
- exports.xpl_secondary_nav = XplSecondaryNav;
292
- exports.xpl_table = XplTable;
293
- exports.xpl_utility_bar = XplUtilityBar;