@blueprintui/grid 0.0.0 → 0.0.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.
@@ -556,6 +556,7 @@
556
556
  {
557
557
  "kind": "field",
558
558
  "name": "i18n",
559
+ "description": "i18n string options",
559
560
  "attribute": "i18n"
560
561
  },
561
562
  {
@@ -564,6 +565,7 @@
564
565
  "type": {
565
566
  "text": "string"
566
567
  },
568
+ "description": "max height for grid container",
567
569
  "attribute": "height",
568
570
  "reflects": true
569
571
  },
@@ -574,6 +576,7 @@
574
576
  "text": "'fixed' | 'flex'"
575
577
  },
576
578
  "default": "'fixed'",
579
+ "description": "column layout determines initial column width calculation",
577
580
  "attribute": "column-layout",
578
581
  "reflects": true
579
582
  },
@@ -584,6 +587,7 @@
584
587
  "text": "'row' | 'cell' | 'column' | 'none' | 'stripe'"
585
588
  },
586
589
  "default": "'row'",
590
+ "description": "determines the visual style of grid cells and rows",
587
591
  "attribute": "borders",
588
592
  "reflects": true
589
593
  },
@@ -593,27 +597,29 @@
593
597
  "type": {
594
598
  "text": "'multi' | 'single' | null"
595
599
  },
600
+ "description": "initializes grid to appropriate aria/a11y settings for selections",
596
601
  "attribute": "selectable",
597
602
  "reflects": true
598
603
  },
599
604
  {
600
605
  "kind": "field",
601
- "name": "rangeSelection",
606
+ "name": "scrollLock",
602
607
  "type": {
603
608
  "text": "boolean"
604
609
  },
605
610
  "default": "false",
606
- "attribute": "range-selection",
611
+ "description": "disables scroll container",
612
+ "attribute": "scroll-lock",
607
613
  "reflects": true
608
614
  },
609
615
  {
610
616
  "kind": "field",
611
- "name": "scrollLock",
617
+ "name": "rangeSelection",
612
618
  "type": {
613
619
  "text": "boolean"
614
620
  },
615
621
  "default": "false",
616
- "attribute": "scroll-lock",
622
+ "attribute": "range-selection",
617
623
  "reflects": true
618
624
  },
619
625
  {
@@ -645,19 +651,23 @@
645
651
  "text": "Set<any>"
646
652
  },
647
653
  "static": true,
648
- "default": "new Set()"
654
+ "default": "new Set()",
655
+ "privacy": "private"
649
656
  },
650
657
  {
651
658
  "kind": "field",
652
- "name": "keyGridControllerConfig"
659
+ "name": "keyGridControllerConfig",
660
+ "privacy": "private"
653
661
  },
654
662
  {
655
663
  "kind": "field",
656
- "name": "gridLayoutControllerConfig"
664
+ "name": "gridLayoutControllerConfig",
665
+ "privacy": "private"
657
666
  },
658
667
  {
659
668
  "kind": "field",
660
- "name": "gridColumnSizeControllerConfig"
669
+ "name": "gridColumnSizeControllerConfig",
670
+ "privacy": "private"
661
671
  },
662
672
  {
663
673
  "kind": "field",
@@ -756,6 +766,7 @@
756
766
  "attributes": [
757
767
  {
758
768
  "name": "i18n",
769
+ "description": "i18n string options",
759
770
  "fieldName": "i18n"
760
771
  },
761
772
  {
@@ -763,6 +774,7 @@
763
774
  "type": {
764
775
  "text": "string"
765
776
  },
777
+ "description": "max height for grid container",
766
778
  "fieldName": "height"
767
779
  },
768
780
  {
@@ -771,6 +783,7 @@
771
783
  "text": "'fixed' | 'flex'"
772
784
  },
773
785
  "default": "'fixed'",
786
+ "description": "column layout determines initial column width calculation",
774
787
  "fieldName": "columnLayout"
775
788
  },
776
789
  {
@@ -779,6 +792,7 @@
779
792
  "text": "'row' | 'cell' | 'column' | 'none' | 'stripe'"
780
793
  },
781
794
  "default": "'row'",
795
+ "description": "determines the visual style of grid cells and rows",
782
796
  "fieldName": "borders"
783
797
  },
784
798
  {
@@ -786,23 +800,25 @@
786
800
  "type": {
787
801
  "text": "'multi' | 'single' | null"
788
802
  },
803
+ "description": "initializes grid to appropriate aria/a11y settings for selections",
789
804
  "fieldName": "selectable"
790
805
  },
791
806
  {
792
- "name": "range-selection",
807
+ "name": "scroll-lock",
793
808
  "type": {
794
809
  "text": "boolean"
795
810
  },
796
811
  "default": "false",
797
- "fieldName": "rangeSelection"
812
+ "description": "disables scroll container",
813
+ "fieldName": "scrollLock"
798
814
  },
799
815
  {
800
- "name": "scroll-lock",
816
+ "name": "range-selection",
801
817
  "type": {
802
818
  "text": "boolean"
803
819
  },
804
820
  "default": "false",
805
- "fieldName": "scrollLock"
821
+ "fieldName": "rangeSelection"
806
822
  },
807
823
  {
808
824
  "name": "elevation",
@@ -2015,6 +2031,7 @@
2015
2031
  "type": {
2016
2032
  "text": "boolean"
2017
2033
  },
2034
+ "description": "selected visual state",
2018
2035
  "attribute": "selected",
2019
2036
  "reflects": true
2020
2037
  },
@@ -2024,6 +2041,7 @@
2024
2041
  "type": {
2025
2042
  "text": "'fixed' | 'sticky' | ''"
2026
2043
  },
2044
+ "description": "position individual row relative to the grid scroll container",
2027
2045
  "attribute": "position",
2028
2046
  "reflects": true
2029
2047
  },
@@ -2047,6 +2065,7 @@
2047
2065
  "type": {
2048
2066
  "text": "boolean"
2049
2067
  },
2068
+ "description": "selected visual state",
2050
2069
  "fieldName": "selected"
2051
2070
  },
2052
2071
  {
@@ -2054,6 +2073,7 @@
2054
2073
  "type": {
2055
2074
  "text": "'fixed' | 'sticky' | ''"
2056
2075
  },
2076
+ "description": "position individual row relative to the grid scroll container",
2057
2077
  "fieldName": "position"
2058
2078
  }
2059
2079
  ],
package/grid/element.d.ts CHANGED
@@ -24,6 +24,7 @@ import { GridLayoutController } from './layout.controller.js';
24
24
  */
25
25
  export declare class BpGrid extends LitElement {
26
26
  #private;
27
+ /** i18n string options */
27
28
  i18n: {
28
29
  sort: string;
29
30
  expand: string;
@@ -52,27 +53,36 @@ export declare class BpGrid extends LitElement {
52
53
  lastPage: string;
53
54
  pageSize: string;
54
55
  };
56
+ /** max height for grid container */
55
57
  height: string;
58
+ /** column layout determines initial column width calculation */
56
59
  columnLayout: 'fixed' | 'flex';
60
+ /** determines the visual style of grid cells and rows */
57
61
  borders: 'row' | 'cell' | 'column' | 'none' | 'stripe';
62
+ /** initializes grid to appropriate aria/a11y settings for selections */
58
63
  selectable: 'multi' | 'single' | null;
59
- rangeSelection: boolean;
64
+ /** disables scroll container */
60
65
  scrollLock: boolean;
66
+ rangeSelection: boolean;
61
67
  elevation: 'raised' | 'flat';
62
68
  protected _id: string;
63
69
  protected gridLayoutController: GridLayoutController;
64
70
  static styles: CSSStyleSheet[];
71
+ /** @private */
65
72
  static controllers: Set<any>;
73
+ /** @private */
66
74
  get keyGridControllerConfig(): {
67
75
  grid: HTMLElement;
68
76
  rows: HTMLElement[];
69
77
  cells: (BpGridCell | BpGridColumn)[];
70
78
  };
79
+ /** @private */
71
80
  get gridLayoutControllerConfig(): {
72
81
  columns: BpGridColumn[];
73
82
  columnLayout: "fixed" | "flex";
74
83
  height: string;
75
84
  };
85
+ /** @private */
76
86
  get gridColumnSizeControllerConfig(): {
77
87
  columns: BpGridColumn[];
78
88
  rows: BpGridRow[];
package/grid/element.js CHANGED
@@ -1 +1 @@
1
- import{__decorate as t}from"tslib";import{LitElement as e,html as o}from"lit";import{baseStyles as i,elevationStyles as r,I18nService as l,createId as s,attachRootNodeStyles as n,i18n as a,ariaMultiSelectable as c}from"@blueprintui/components/internals";import{interactionScrollVisibility as h}from"../internals/controllers/interaction-scroll-visibility.controller.js";import{GridLayoutController as u}from"./layout.controller.js";import d from"./element.css.js";import p from"./global.css.js";var m;let g=m=class extends e{static properties={i18n:{type:Object},height:{type:String,reflect:!0},columnLayout:{type:String,reflect:!0,attribute:"column-layout"},borders:{type:String,reflect:!0},selectable:{type:String,reflect:!0},rangeSelection:{type:Boolean,reflect:!0,attribute:"range-selection"},scrollLock:{type:Boolean,reflect:!0,attribute:"scroll-lock"},elevation:{type:String,reflect:!0},_id:{type:String,reflect:!0}};gridLayoutController=new u(this);static styles=[i,r,d];static controllers=new Set;get keyGridControllerConfig(){return{grid:this.keyNavGrid,rows:[this.#t,...Array.from(this.#e)],cells:[...Array.from(this.#o),...Array.from(this.#i)]}}get gridLayoutControllerConfig(){return{columns:Array.from(this.#o),columnLayout:this.columnLayout,height:this.height}}get gridColumnSizeControllerConfig(){return{columns:Array.from(this.#o),rows:Array.from(this.#e)}}get#o(){return this.querySelectorAll("bp-grid-column")}get#t(){return this.shadowRoot.querySelector(".column-row-group")}get#e(){return this.querySelectorAll("bp-grid-row")}get#i(){return this.querySelectorAll("bp-grid-cell")}get#r(){return this.querySelector("bp-grid-placeholder")}get#l(){return this.querySelector("bp-grid-footer")}get keyNavGrid(){return this.shadowRoot.querySelector(".scroll-container")}_internals=this.attachInternals();render(){return o`<div role="presentation" elevation part="internal"><div role="presentation" class="scroll-container"><div role="presentation" class="column-row-group"><div role="row" aria-rowindex="1" class="column-row"><slot name="columns"><bp-grid-column draggable-hidden><span sr-only>${this.i18n.noData}</span></bp-grid-column></slot></div></div><slot role="presentation" class="body-row-group"></slot></div><slot name="footer"></slot><slot name="detail"></slot></div>`}constructor(){super();this._internals.role="grid",this.#s(),this.i18n=l.keys.actions,this.columnLayout="fixed",this.borders="row",this.rangeSelection=!1,this.scrollLock=!1,this._id=s()}async connectedCallback(){super.connectedCallback(),n(this.parentNode,[p]),await this.updateComplete,m.controllers.forEach((t=>new t(this))),this.#n(),this.shadowRoot.addEventListener("slotchange",(()=>this.updateComplete.then((()=>this.#n()))))}#s(){this.addEventListener("sort",(t=>{const e=t.composedPath().find((t=>"BP-GRID-COLUMN"===t.tagName));e&&(e.ariaSort=t.detail)}))}#a=0;get#c(){return this.#a++,1===this.#a&&!this.rangeSelection&&!Array.from(this.#o).find((t=>""!==t.position||void 0!==t.type))}async#n(){this.#c||(this.#h(),this.#u(),this.#d(),this.#p(),this.#m(),this.#g())}#h(){const t=Math.max(this.#e?.length,1),e=this.#l?1:0;this._internals.ariaRowCount=""+(1+t+e),this._internals.ariaColCount=""+this.#o.length}#u(){this.#o.forEach(((t,e)=>t.ariaColIndex=""+(e+1)))}#d(){this.#e?.forEach(((t,e)=>t.ariaRowIndex=""+(e+2)))}#p(){this.#i?.forEach(((t,e)=>t.ariaColIndex=""+(e%this.#o.length+1)))}#m(){this.#r&&(this.#r.ariaRowCount=""+(this.#e.length+1),this.#r._colSpan=this._internals.ariaColCount)}#g(){this.#l&&(this.#l.ariaRowCount=""+(this.#e.length+2),this.#l._colSpan=this._internals.ariaColCount)}};g=m=t([a({key:"actions"}),c(),h()],g);export{g as BpGrid};
1
+ import{__decorate as t}from"tslib";import{LitElement as e,html as o}from"lit";import{baseStyles as i,elevationStyles as r,I18nService as l,createId as s,attachRootNodeStyles as n,i18n as a,ariaMultiSelectable as c}from"@blueprintui/components/internals";import{interactionScrollVisibility as h}from"../internals/controllers/interaction-scroll-visibility.controller.js";import{GridLayoutController as u}from"./layout.controller.js";import d from"./element.css.js";import p from"./global.css.js";var m;let g=m=class extends e{static properties={i18n:{type:Object},height:{type:String,reflect:!0},columnLayout:{type:String,reflect:!0,attribute:"column-layout"},borders:{type:String,reflect:!0},selectable:{type:String,reflect:!0},scrollLock:{type:Boolean,reflect:!0,attribute:"scroll-lock"},rangeSelection:{type:Boolean,reflect:!0,attribute:"range-selection"},elevation:{type:String,reflect:!0},_id:{type:String,reflect:!0}};gridLayoutController=new u(this);static styles=[i,r,d];static controllers=new Set;get keyGridControllerConfig(){return{grid:this.keyNavGrid,rows:[this.#t,...Array.from(this.#e)],cells:[...Array.from(this.#o),...Array.from(this.#i)]}}get gridLayoutControllerConfig(){return{columns:Array.from(this.#o),columnLayout:this.columnLayout,height:this.height}}get gridColumnSizeControllerConfig(){return{columns:Array.from(this.#o),rows:Array.from(this.#e)}}get#o(){return this.querySelectorAll("bp-grid-column")}get#t(){return this.shadowRoot.querySelector(".column-row-group")}get#e(){return this.querySelectorAll("bp-grid-row")}get#i(){return this.querySelectorAll("bp-grid-cell")}get#r(){return this.querySelector("bp-grid-placeholder")}get#l(){return this.querySelector("bp-grid-footer")}get keyNavGrid(){return this.shadowRoot.querySelector(".scroll-container")}_internals=this.attachInternals();render(){return o`<div role="presentation" elevation part="internal"><div role="presentation" class="scroll-container"><div role="presentation" class="column-row-group"><div role="row" aria-rowindex="1" class="column-row"><slot name="columns"><bp-grid-column draggable-hidden><span sr-only>${this.i18n.noData}</span></bp-grid-column></slot></div></div><slot role="presentation" class="body-row-group"></slot></div><slot name="footer"></slot><slot name="detail"></slot></div>`}constructor(){super();this._internals.role="grid",this.#s(),this.i18n=l.keys.actions,this.columnLayout="fixed",this.borders="row",this.scrollLock=!1,this.rangeSelection=!1,this._id=s()}async connectedCallback(){super.connectedCallback(),n(this.parentNode,[p]),await this.updateComplete,m.controllers.forEach((t=>new t(this))),this.#n(),this.shadowRoot.addEventListener("slotchange",(()=>this.updateComplete.then((()=>this.#n()))))}#s(){this.addEventListener("sort",(t=>{const e=t.composedPath().find((t=>"BP-GRID-COLUMN"===t.tagName));e&&(e.ariaSort=t.detail)}))}#a=0;get#c(){return this.#a++,1===this.#a&&!this.rangeSelection&&!Array.from(this.#o).find((t=>""!==t.position||void 0!==t.type))}async#n(){this.#c||(this.#h(),this.#u(),this.#d(),this.#p(),this.#m(),this.#g())}#h(){const t=Math.max(this.#e?.length,1),e=this.#l?1:0;this._internals.ariaRowCount=""+(1+t+e),this._internals.ariaColCount=""+this.#o.length}#u(){this.#o.forEach(((t,e)=>t.ariaColIndex=""+(e+1)))}#d(){this.#e?.forEach(((t,e)=>t.ariaRowIndex=""+(e+2)))}#p(){this.#i?.forEach(((t,e)=>t.ariaColIndex=""+(e%this.#o.length+1)))}#m(){this.#r&&(this.#r.ariaRowCount=""+(this.#e.length+1),this.#r._colSpan=this._internals.ariaColCount)}#g(){this.#l&&(this.#l.ariaRowCount=""+(this.#e.length+2),this.#l._colSpan=this._internals.ariaColCount)}};g=m=t([a({key:"actions"}),c(),h()],g);export{g as BpGrid};
package/include/keynav.js CHANGED
@@ -1 +1 @@
1
- import{BpGrid as r}from"../grid/element.js";import{KeyGridController as o}from"../internals/controllers/key-grid.controller.js";r.controllers.add(o);
1
+ import{KeyGridController as e}from"../internals/controllers/key-grid.controller.js";await customElements.whenDefined("bp-grid"),customElements.get("bp-grid").controllers.add(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueprintui/grid",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "main": "./index.js",
5
5
  "module": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -38,7 +38,10 @@
38
38
  "./*": "./*/index.js"
39
39
  },
40
40
  "dependencies": {
41
- "@blueprintui/components": "^0.0.31",
42
- "lit": "^2.5.0"
41
+ "@blueprintui/components": "^0.0.33",
42
+ "@blueprintui/icons": "^0.0.22",
43
+ "@blueprintui/themes": "^0.0.12",
44
+ "lit": "^2.5.0",
45
+ "tslib": "^2.4.1"
43
46
  }
44
47
  }
package/row/element.d.ts CHANGED
@@ -14,7 +14,9 @@ import { LitElement } from 'lit';
14
14
  */
15
15
  export declare class BpGridRow extends LitElement {
16
16
  #private;
17
+ /** selected visual state */
17
18
  selected: boolean;
19
+ /** position individual row relative to the grid scroll container */
18
20
  position: 'fixed' | 'sticky' | '';
19
21
  static styles: CSSStyleSheet[];
20
22
  render(): import("lit-html").TemplateResult<1>;