@proximus/lavender-grid 1.0.0-alpha.4

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 (2) hide show
  1. package/dist/PxGrid.es.js +547 -0
  2. package/package.json +30 -0
@@ -0,0 +1,547 @@
1
+ import { PxElement as r, gapValues as d } from "@proximus/lavender-common";
2
+ const u = ":host{--grid-cols: initial;--grid-cols-mobile: initial;--grid-cols-tablet: initial;--grid-cols-laptop: initial;--grid-cols-desktop: initial;--justify-content: initial;--justify-items: initial;--align-content: initial;--align-items: initial;--place-content: initial;--place-items: initial;display:grid}.grid{display:grid;gap:var(--px-gap-mobile);grid-template-columns:repeat(var(--grid-cols),minmax(0,1fr));justify-content:var(--justify-content);justify-items:var(--justify-items);align-content:var(--align-content);align-items:var(--align-items);place-content:var(--place-content);place-items:var(--place-items)}.grid ::slotted(px-grid-item){display:grid}.grid.flex{display:flex;flex-flow:row wrap}.grid.flex ::slotted(px-grid-item){display:flex;flex:1 1 0px}.grid.flex ::slotted(px-grid-item[shrink]){flex:0 0 auto}.gap-expanded{gap:var(--px-gap-tablet-expanded)}.gap-none{gap:var(--px-gap-none)!important}.justify-content-normal{justify-content:normal}.justify-content-start{justify-content:start}.justify-content-end{justify-content:end}.justify-content-center{justify-content:center}.justify-content-space-between{justify-content:space-between}.justify-content-space-around{justify-content:space-around}.justify-content-space-evenly{justify-content:space-evenly}.justify-content-stretch{justify-content:stretch}.justify-items-start{justify-items:start}.justify-items-end{justify-items:end}.justify-items-center{justify-items:center}.justify-items-stretch{justify-items:stretch}.align-content-normal{align-content:normal}.align-content-start{align-content:start}.align-content-end{align-content:end}.align-content-center{align-content:center}.align-content-space-between{align-content:space-between}.align-content-space-around{align-content:space-around}.align-content-space-evenly{align-content:space-evenly}.align-content-stretch{align-content:stretch}.align-items-start{align-items:start}.align-items-end{align-items:end}.align-items-center{align-items:center}.align-items-stretch{align-items:stretch}.place-content-normal{place-content:normal}.place-content-start{place-content:start}.place-content-end{place-content:end}.place-content-center{place-content:center}.place-content-space-between{place-content:space-between}.place-content-space-around{place-content:space-around}.place-content-space-evenly{place-content:space-evenly}.place-content-stretch{place-content:stretch}.place-items-start{place-items:start}.place-items-end{place-items:end}.place-items-center{place-items:center}.place-items-stretch{place-items:stretch}@media only screen and (max-width: 767px){.grid{gap:var(--px-gap-mobile);grid-template-columns:repeat(var(--grid-cols-mobile, var(--grid-cols)),minmax(0,1fr))}.gap-expanded{gap:var(--px-gap-mobile-expanded)}.justify-content-normal-mobile{justify-content:normal}.justify-content-start-mobile{justify-content:start}.justify-content-end-mobile{justify-content:end}.justify-content-center-mobile{justify-content:center}.justify-content-space-between-mobile{justify-content:space-between}.justify-content-space-around-mobile{justify-content:space-around}.justify-content-space-evenly-mobile{justify-content:space-evenly}.justify-content-stretch-mobile{justify-content:stretch}.justify-items-start-mobile{justify-items:start}.justify-items-end-mobile{justify-items:end}.justify-items-center-mobile{justify-items:center}.justify-items-stretch-mobile{justify-items:stretch}.align-content-normal-mobile{align-content:normal}.align-content-start-mobile{align-content:start}.align-content-end-mobile{align-content:end}.align-content-center-mobile{align-content:center}.align-content-space-between-mobile{align-content:space-between}.align-content-space-around-mobile{align-content:space-around}.align-content-space-evenly-mobile{align-content:space-evenly}.align-content-stretch-mobile{align-content:stretch}.align-items-start-mobile{align-items:start}.align-items-end-mobile{align-items:end}.align-items-center-mobile{align-items:center}.align-items-stretch-mobile{align-items:stretch}.place-content-normal-mobile{place-content:normal}.place-content-start-mobile{place-content:start}.place-content-end-mobile{place-content:end}.place-content-center-mobile{place-content:center}.place-content-space-between-mobile{place-content:space-between}.place-content-space-around-mobile{place-content:space-around}.place-content-space-evenly-mobile{place-content:space-evenly}.place-content-stretch-mobile{place-content:stretch}.place-items-start-mobile{place-items:start}.place-items-end-mobile{place-items:end}.place-items-center-mobile{place-items:center}.place-items-stretch-mobile{place-items:stretch}}@media only screen and (min-width: 768px) and (max-width: 1024px){.grid{gap:var(--px-gap-tablet);grid-template-columns:repeat(var(--grid-cols-tablet, var(--grid-cols)),minmax(0,1fr))}.justify-content-normal-tablet{justify-content:normal}.justify-content-start-tablet{justify-content:start}.justify-content-end-tablet{justify-content:end}.justify-content-center-tablet{justify-content:center}.justify-content-space-between-tablet{justify-content:space-between}.justify-content-space-around-tablet{justify-content:space-around}.justify-content-space-evenly-tablet{justify-content:space-evenly}.justify-content-stretch-tablet{justify-content:stretch}.justify-items-start-tablet{justify-items:start}.justify-items-end-tablet{justify-items:end}.justify-items-center-tablet{justify-items:center}.justify-items-stretch-tablet{justify-items:stretch}.align-content-normal-tablet{align-content:normal}.align-content-start-tablet{align-content:start}.align-content-end-tablet{align-content:end}.align-content-center-tablet{align-content:center}.align-content-space-between-tablet{align-content:space-between}.align-content-space-around-tablet{align-content:space-around}.align-content-space-evenly-tablet{align-content:space-evenly}.align-content-stretch-tablet{align-content:stretch}.align-items-start-tablet{align-items:start}.align-items-end-tablet{align-items:end}.align-items-center-tablet{align-items:center}.align-items-stretch-tablet{align-items:stretch}.place-content-normal-tablet{place-content:normal}.place-content-start-tablet{place-content:start}.place-content-end-tablet{place-content:end}.place-content-center-tablet{place-content:center}.place-content-space-between-tablet{place-content:space-between}.place-content-space-around-tablet{place-content:space-around}.place-content-space-evenly-tablet{place-content:space-evenly}.place-content-stretch-tablet{place-content:stretch}.place-items-start-tablet{place-items:start}.place-items-end-tablet{place-items:end}.place-items-center-tablet{place-items:center}.place-items-stretch-tablet{place-items:stretch}}@media only screen and (min-width: 1025px) and (max-width: 1440px){.grid{grid-template-columns:repeat(var(--grid-cols-laptop, var(--grid-cols)),minmax(0,1fr))}.justify-content-normal-laptop{justify-content:normal}.justify-content-start-laptop{justify-content:start}.justify-content-end-laptop{justify-content:end}.justify-content-center-laptop{justify-content:center}.justify-content-space-between-laptop{justify-content:space-between}.justify-content-space-around-laptop{justify-content:space-around}.justify-content-space-evenly-laptop{justify-content:space-evenly}.justify-content-stretch-laptop{justify-content:stretch}.justify-items-start-laptop{justify-items:start}.justify-items-end-laptop{justify-items:end}.justify-items-center-laptop{justify-items:center}.justify-items-stretch-laptop{justify-items:stretch}.align-content-normal-laptop{align-content:normal}.align-content-start-laptop{align-content:start}.align-content-end-laptop{align-content:end}.align-content-center-laptop{align-content:center}.align-content-space-between-laptop{align-content:space-between}.align-content-space-around-laptop{align-content:space-around}.align-content-space-evenly-laptop{align-content:space-evenly}.align-content-stretch-laptop{align-content:stretch}.align-items-start-laptop{align-items:start}.align-items-end-laptop{align-items:end}.align-items-center-laptop{align-items:center}.align-items-stretch-laptop{align-items:stretch}.place-content-normal-laptop{place-content:normal}.place-content-start-laptop{place-content:start}.place-content-end-laptop{place-content:end}.place-content-center-laptop{place-content:center}.place-content-space-between-laptop{place-content:space-between}.place-content-space-around-laptop{place-content:space-around}.place-content-space-evenly-laptop{place-content:space-evenly}.place-content-stretch-laptop{place-content:stretch}.place-items-start-laptop{place-items:start}.place-items-end-laptop{place-items:end}.place-items-center-laptop{place-items:center}.place-items-stretch-laptop{place-items:stretch}}@media only screen and (min-width: 1441px){.grid{grid-template-columns:repeat(var(--grid-cols-desktop, var(--grid-cols)),minmax(0,1fr))}.justify-content-normal-desktop{justify-content:normal}.justify-content-start-desktop{justify-content:start}.justify-content-end-desktop{justify-content:end}.justify-content-center-desktop{justify-content:center}.justify-content-space-between-desktop{justify-content:space-between}.justify-content-space-around-desktop{justify-content:space-around}.justify-content-space-evenly-desktop{justify-content:space-evenly}.justify-content-stretch-desktop{justify-content:stretch}.justify-items-start-desktop{justify-items:start}.justify-items-end-desktop{justify-items:end}.justify-items-center-desktop{justify-items:center}.justify-items-stretch-desktop{justify-items:stretch}.align-content-normal-desktop{align-content:normal}.align-content-start-desktop{align-content:start}.align-content-end-desktop{align-content:end}.align-content-center-desktop{align-content:center}.align-content-space-between-desktop{align-content:space-between}.align-content-space-around-desktop{align-content:space-around}.align-content-space-evenly-desktop{align-content:space-evenly}.align-content-stretch-desktop{align-content:stretch}.align-items-start-desktop{align-items:start}.align-items-end-desktop{align-items:end}.align-items-center-desktop{align-items:center}.align-items-stretch-desktop{align-items:stretch}.place-content-normal-desktop{place-content:normal}.place-content-start-desktop{place-content:start}.place-content-end-desktop{place-content:end}.place-content-center-desktop{place-content:center}.place-content-space-between-desktop{place-content:space-between}.place-content-space-around-desktop{place-content:space-around}.place-content-space-evenly-desktop{place-content:space-evenly}.place-content-stretch-desktop{place-content:stretch}.place-items-start-desktop{place-items:start}.place-items-end-desktop{place-items:end}.place-items-center-desktop{place-items:center}.place-items-stretch-desktop{place-items:stretch}}", g = '.grid-item{display:grid;width:100%}::slotted([col-span="1"]){grid-column:span 1 / span 1}::slotted([col-span="2"]){grid-column:span 2 / span 2}::slotted([col-span="3"]){grid-column:span 3 / span 3}::slotted([col-span="4"]){grid-column:span 4 / span 4}::slotted([col-span="5"]){grid-column:span 5 / span 5}::slotted([col-span="6"]){grid-column:span 6 / span 6}::slotted([col-span="7"]){grid-column:span 7 / span 7}::slotted([col-span="8"]){grid-column:span 8 / span 8}::slotted([col-span="9"]){grid-column:span 9 / span 9}::slotted([col-span="10"]){grid-column:span 10 / span 10}::slotted([col-span="11"]){grid-column:span 11 / span 11}::slotted([col-span="12"]){grid-column:span 12 / span 12}::slotted([col-span="full"]){grid-column:1 / -1}::slotted([order="1"]){order:1}::slotted([order="2"]){order:2}::slotted([order="3"]){order:3}::slotted([order="4"]){order:4}::slotted([order="5"]){order:5}::slotted([order="6"]){order:6}::slotted([order="first"]){order:-9999}::slotted([order="last"]){order:9999}::slotted([order="none"]){order:0}::slotted([justify-self="auto"]){justify-self:auto}::slotted([justify-self="start"]){justify-self:start}::slotted([justify-self="end"]){justify-self:end}::slotted([justify-self="center"]){justify-self:center}::slotted([justify-self="stretch"]){justify-self:stretch}::slotted([align-self="auto"]){align-self:auto}::slotted([align-self="start"]){align-self:start}::slotted([align-self="end"]){align-self:end}::slotted([align-self="center"]){align-self:center}::slotted([align-self="stretch"]){align-self:stretch}::slotted([place-self="auto"]){place-self:auto}::slotted([place-self="start"]){place-self:start}::slotted([place-self="end"]){place-self:end}::slotted([place-self="center"]){place-self:center}::slotted([place-self="stretch"]){place-self:stretch}@media only screen and (max-width: 767px){::slotted([col-mobile="auto"]){grid-column:auto}::slotted([col-span-mobile="1"]){grid-column:span 1 / span 1}::slotted([col-span-mobile="2"]){grid-column:span 2 / span 2}::slotted([col-span-mobile="3"]){grid-column:span 3 / span 3}::slotted([col-span-mobile="4"]){grid-column:span 4 / span 4}::slotted([col-span-mobile="5"]){grid-column:span 5 / span 5}::slotted([col-span-mobile="6"]){grid-column:span 6 / span 6}::slotted([col-span-mobile="7"]){grid-column:span 7 / span 7}::slotted([col-span-mobile="8"]){grid-column:span 8 / span 8}::slotted([col-span-mobile="9"]){grid-column:span 9 / span 9}::slotted([col-span-mobile="10"]){grid-column:span 10 / span 10}::slotted([col-span-mobile="11"]){grid-column:span 11 / span 11}::slotted([col-span-mobile="12"]){grid-column:span 12 / span 12}::slotted([col-span-mobile="full"]){grid-column:1 / -1}::slotted([order-mobile="1"]){order:1}::slotted([order-mobile="2"]){order:2}::slotted([order-mobile="3"]){order:3}::slotted([order-mobile="4"]){order:4}::slotted([order-mobile="5"]){order:5}::slotted([order-mobile="6"]){order:6}::slotted([order-mobile="first"]){order:-9999}::slotted([order-mobile="last"]){order:9999}::slotted([order-mobile="none"]){order:0}::slotted([justify-self-mobile="auto"]){justify-self:auto}::slotted([justify-self-mobile="start"]){justify-self:start}::slotted([justify-self-mobile="end"]){justify-self:end}::slotted([justify-self-mobile="center"]){justify-self:center}::slotted([justify-self-mobile="stretch"]){justify-self:stretch}::slotted([align-self-mobile="auto"]){align-self:auto}::slotted([align-self-mobile="start"]){align-self:start}::slotted([align-self-mobile="end"]){align-self:end}::slotted([align-self-mobile="center"]){align-self:center}::slotted([align-self-mobile="stretch"]){align-self:stretch}::slotted([place-self-mobile="auto"]){place-self:auto}::slotted([place-self-mobile="start"]){place-self:start}::slotted([place-self-mobile="end"]){place-self:end}::slotted([place-self-mobile="center"]){place-self:center}::slotted([place-self-mobile="stretch"]){place-self:stretch}}@media only screen and (min-width: 768px) and (max-width: 1024px){::slotted([col-tablet="auto"]){grid-column:auto}::slotted([col-span-tablet="1"]){grid-column:span 1 / span 1}::slotted([col-span-tablet="2"]){grid-column:span 2 / span 2}::slotted([col-span-tablet="3"]){grid-column:span 3 / span 3}::slotted([col-span-tablet="4"]){grid-column:span 4 / span 4}::slotted([col-span-tablet="5"]){grid-column:span 5 / span 5}::slotted([col-span-tablet="6"]){grid-column:span 6 / span 6}::slotted([col-span-tablet="7"]){grid-column:span 7 / span 7}::slotted([col-span-tablet="8"]){grid-column:span 8 / span 8}::slotted([col-span-tablet="9"]){grid-column:span 9 / span 9}::slotted([col-span-tablet="10"]){grid-column:span 10 / span 10}::slotted([col-span-tablet="11"]){grid-column:span 11 / span 11}::slotted([col-span-tablet="12"]){grid-column:span 12 / span 12}::slotted([col-span-tablet="full"]){grid-column:1 / -1}::slotted([order-tablet="1"]){order:1}::slotted([order-tablet="2"]){order:2}::slotted([order-tablet="3"]){order:3}::slotted([order-tablet="4"]){order:4}::slotted([order-tablet="5"]){order:5}::slotted([order-tablet="6"]){order:6}::slotted([order-tablet="first"]){order:-9999}::slotted([order-tablet="last"]){order:9999}::slotted([order-tablet="none"]){order:0}::slotted([justify-self-tablet="auto"]){justify-self:auto}::slotted([justify-self-tablet="start"]){justify-self:start}::slotted([justify-self-tablet="end"]){justify-self:end}::slotted([justify-self-tablet="center"]){justify-self:center}::slotted([justify-self-tablet="stretch"]){justify-self:stretch}::slotted([align-self-tablet="auto"]){align-self:auto}::slotted([align-self-tablet="start"]){align-self:start}::slotted([align-self-tablet="end"]){align-self:end}::slotted([align-self-tablet="center"]){align-self:center}::slotted([align-self-tablet="stretch"]){align-self:stretch}::slotted([place-self-tablet="auto"]){place-self:auto}::slotted([place-self-tablet="start"]){place-self:start}::slotted([place-self-tablet="end"]){place-self:end}::slotted([place-self-tablet="center"]){place-self:center}::slotted([place-self-tablet="stretch"]){place-self:stretch}}@media only screen and (min-width: 1025px){::slotted([col-laptop="auto"]){grid-column:auto}::slotted([col-span-laptop="1"]){grid-column:span 1 / span 1}::slotted([col-span-laptop="2"]){grid-column:span 2 / span 2}::slotted([col-span-laptop="3"]){grid-column:span 3 / span 3}::slotted([col-span-laptop="4"]){grid-column:span 4 / span 4}::slotted([col-span-laptop="5"]){grid-column:span 5 / span 5}::slotted([col-span-laptop="6"]){grid-column:span 6 / span 6}::slotted([col-span-laptop="7"]){grid-column:span 7 / span 7}::slotted([col-span-laptop="8"]){grid-column:span 8 / span 8}::slotted([col-span-laptop="9"]){grid-column:span 9 / span 9}::slotted([col-span-laptop="10"]){grid-column:span 10 / span 10}::slotted([col-span-laptop="11"]){grid-column:span 11 / span 11}::slotted([col-span-laptop="12"]){grid-column:span 12 / span 12}::slotted([col-span-laptop="full"]){grid-column:1 / -1}::slotted([justify-self-laptop="auto"]){justify-self:auto}::slotted([justify-self-laptop="start"]){justify-self:start}::slotted([justify-self-laptop="end"]){justify-self:end}::slotted([justify-self-laptop="center"]){justify-self:center}::slotted([justify-self-laptop="stretch"]){justify-self:stretch}::slotted([align-self-laptop="auto"]){align-self:auto}::slotted([align-self-laptop="start"]){align-self:start}::slotted([align-self-laptop="end"]){align-self:end}::slotted([align-self-laptop="center"]){align-self:center}::slotted([align-self-laptop="stretch"]){align-self:stretch}::slotted([place-self-laptop="auto"]){place-self:auto}::slotted([place-self-laptop="start"]){place-self:start}::slotted([place-self-laptop="end"]){place-self:end}::slotted([place-self-laptop="center"]){place-self:center}::slotted([place-self-laptop="stretch"]){place-self:stretch}}', o = new CSSStyleSheet();
3
+ o.replaceSync(u);
4
+ const c = new CSSStyleSheet();
5
+ c.replaceSync(g);
6
+ const f = [
7
+ "",
8
+ "1",
9
+ "2",
10
+ "3",
11
+ "4",
12
+ "5",
13
+ "6",
14
+ "7",
15
+ "8",
16
+ "9",
17
+ "10",
18
+ "11",
19
+ "12"
20
+ ], m = [
21
+ "",
22
+ "start",
23
+ "end",
24
+ "center",
25
+ "space-between",
26
+ "space-around",
27
+ "space-evenly",
28
+ "stretch"
29
+ ], a = class a extends r {
30
+ constructor() {
31
+ super(o, c), this.template = () => `<div class="grid">
32
+ <slot></slot>
33
+ </div>`, this.shadowRoot.innerHTML = this.template();
34
+ }
35
+ static get observedAttributes() {
36
+ return [
37
+ ...super.observedAttributes,
38
+ "gap",
39
+ "grid-cols",
40
+ "grid-cols-mobile",
41
+ "grid-cols-tablet",
42
+ "grid-cols-laptop",
43
+ "grid-cols-desktop",
44
+ "justify-content",
45
+ "justify-items",
46
+ "align-content",
47
+ "align-items",
48
+ "place-content",
49
+ "place-items",
50
+ "justify-content-mobile",
51
+ "justify-items-mobile",
52
+ "align-content-mobile",
53
+ "align-items-mobile",
54
+ "place-content-mobile",
55
+ "place-items-mobile",
56
+ "justify-content-tablet",
57
+ "justify-items-tablet",
58
+ "align-content-tablet",
59
+ "align-items-tablet",
60
+ "place-content-tablet",
61
+ "place-items-tablet",
62
+ "justify-content-laptop",
63
+ "justify-items-laptop",
64
+ "align-content-laptop",
65
+ "align-items-laptop",
66
+ "place-content-laptop",
67
+ "place-items-laptop",
68
+ "justify-content-desktop",
69
+ "justify-items-desktop",
70
+ "align-content-desktop",
71
+ "align-items-desktop",
72
+ "place-content-desktop",
73
+ "place-items-desktop"
74
+ ];
75
+ }
76
+ get gap() {
77
+ return this.getAttribute("gap");
78
+ }
79
+ set gap(t) {
80
+ this.setAttribute("gap", t);
81
+ }
82
+ get gridCols() {
83
+ return this.getAttribute("grid-cols");
84
+ }
85
+ set gridCols(t) {
86
+ this.setAttribute("grid-cols", t);
87
+ }
88
+ get gridColsMobile() {
89
+ return this.getAttribute("grid-cols-mobile");
90
+ }
91
+ set gridColsMobile(t) {
92
+ this.setAttribute("grid-cols-mobile", t);
93
+ }
94
+ get gridColsTablet() {
95
+ return this.getAttribute("grid-cols-tablet");
96
+ }
97
+ set gridColsTablet(t) {
98
+ this.setAttribute("grid-cols-tablet", t);
99
+ }
100
+ get gridColsLaptop() {
101
+ return this.getAttribute("grid-cols-laptop");
102
+ }
103
+ set gridColsLaptop(t) {
104
+ this.setAttribute("grid-cols-laptop", t);
105
+ }
106
+ get gridColsDesktop() {
107
+ return this.getAttribute("grid-cols-desktop");
108
+ }
109
+ set gridColsDesktop(t) {
110
+ this.setAttribute("grid-cols-desktop", t);
111
+ }
112
+ get justifyContent() {
113
+ return this.getAttribute("justify-content");
114
+ }
115
+ set justifyContent(t) {
116
+ this.setAttribute("justify-content", t);
117
+ }
118
+ get justifyItems() {
119
+ return this.getAttribute("justify-items");
120
+ }
121
+ set justifyItems(t) {
122
+ this.setAttribute("justify-items", t);
123
+ }
124
+ get alignContent() {
125
+ return this.getAttribute("align-content");
126
+ }
127
+ set alignContent(t) {
128
+ this.setAttribute("align-content", t);
129
+ }
130
+ get alignItems() {
131
+ return this.getAttribute("align-items");
132
+ }
133
+ set alignItems(t) {
134
+ this.setAttribute("align-items", t);
135
+ }
136
+ get placeContent() {
137
+ return this.getAttribute("place-content");
138
+ }
139
+ set placeContent(t) {
140
+ this.setAttribute("place-content", t);
141
+ }
142
+ get placeItems() {
143
+ return this.getAttribute("place-items");
144
+ }
145
+ set placeItems(t) {
146
+ this.setAttribute("place-items", t);
147
+ }
148
+ get justifyContentMobile() {
149
+ return this.getAttribute("justify-content-mobile");
150
+ }
151
+ set justifyContentMobile(t) {
152
+ this.setAttribute("justify-content-mobile", t);
153
+ }
154
+ get justifyItemsMobile() {
155
+ return this.getAttribute("justify-items-mobile");
156
+ }
157
+ set justifyItemsMobile(t) {
158
+ this.setAttribute("justify-items-mobile", t);
159
+ }
160
+ get alignContentMobile() {
161
+ return this.getAttribute("align-content-mobile");
162
+ }
163
+ set alignContentMobile(t) {
164
+ this.setAttribute("align-content-mobile", t);
165
+ }
166
+ get alignItemsMobile() {
167
+ return this.getAttribute("align-items-mobile");
168
+ }
169
+ set alignItemsMobile(t) {
170
+ this.setAttribute("align-items-mobile", t);
171
+ }
172
+ get placeContentMobile() {
173
+ return this.getAttribute("place-content-mobile");
174
+ }
175
+ set placeContentMobile(t) {
176
+ this.setAttribute("place-content-mobile", t);
177
+ }
178
+ get placeItemsMobile() {
179
+ return this.getAttribute("place-items-mobile");
180
+ }
181
+ set placeItemsMobile(t) {
182
+ this.setAttribute("place-items-mobile", t);
183
+ }
184
+ get justifyContentTablet() {
185
+ return this.getAttribute("justify-content-tablet");
186
+ }
187
+ set justifyContentTablet(t) {
188
+ this.setAttribute("justify-content-tablet", t);
189
+ }
190
+ get justifyItemsTablet() {
191
+ return this.getAttribute("justify-items-tablet");
192
+ }
193
+ set justifyItemsTablet(t) {
194
+ this.setAttribute("justify-items-tablet", t);
195
+ }
196
+ get alignContentTablet() {
197
+ return this.getAttribute("align-content-tablet");
198
+ }
199
+ set alignContentTablet(t) {
200
+ this.setAttribute("align-content-tablet", t);
201
+ }
202
+ get alignItemsTablet() {
203
+ return this.getAttribute("align-items-tablet");
204
+ }
205
+ set alignItemsTablet(t) {
206
+ this.setAttribute("align-items-tablet", t);
207
+ }
208
+ get placeContentTablet() {
209
+ return this.getAttribute("place-content-tablet");
210
+ }
211
+ set placeContentTablet(t) {
212
+ this.setAttribute("place-content-tablet", t);
213
+ }
214
+ get placeItemsTablet() {
215
+ return this.getAttribute("place-items-tablet");
216
+ }
217
+ set placeItemsTablet(t) {
218
+ this.setAttribute("place-items-tablet", t);
219
+ }
220
+ get justifyContentLaptop() {
221
+ return this.getAttribute("justify-content-laptop");
222
+ }
223
+ set justifyContentLaptop(t) {
224
+ this.setAttribute("justify-content-laptop", t);
225
+ }
226
+ get justifyItemsLaptop() {
227
+ return this.getAttribute("justify-items-laptop");
228
+ }
229
+ set justifyItemsLaptop(t) {
230
+ this.setAttribute("justify-items-laptop", t);
231
+ }
232
+ get alignContentLaptop() {
233
+ return this.getAttribute("align-content-laptop");
234
+ }
235
+ set alignContentLaptop(t) {
236
+ this.setAttribute("align-content-laptop", t);
237
+ }
238
+ get alignItemsLaptop() {
239
+ return this.getAttribute("align-items-laptop");
240
+ }
241
+ set alignItemsLaptop(t) {
242
+ this.setAttribute("align-items-laptop", t);
243
+ }
244
+ get placeContentLaptop() {
245
+ return this.getAttribute("place-content-laptop");
246
+ }
247
+ set placeContentLaptop(t) {
248
+ this.setAttribute("place-content-laptop", t);
249
+ }
250
+ get placeItemsLaptop() {
251
+ return this.getAttribute("place-items-laptop");
252
+ }
253
+ set placeItemsLaptop(t) {
254
+ this.setAttribute("place-items-laptop", t);
255
+ }
256
+ get justifyContentDesktop() {
257
+ return this.getAttribute("justify-content-desktop");
258
+ }
259
+ set justifyContentDesktop(t) {
260
+ this.setAttribute("justify-content-desktop", t);
261
+ }
262
+ get justifyItemsDesktop() {
263
+ return this.getAttribute("justify-items-desktop");
264
+ }
265
+ set justifyItemsDesktop(t) {
266
+ this.setAttribute("justify-items-desktop", t);
267
+ }
268
+ get alignContentDesktop() {
269
+ return this.getAttribute("align-content-desktop");
270
+ }
271
+ set alignContentDesktop(t) {
272
+ this.setAttribute("align-content-desktop", t);
273
+ }
274
+ get alignItemsDesktop() {
275
+ return this.getAttribute("align-items-desktop");
276
+ }
277
+ set alignItemsDesktop(t) {
278
+ this.setAttribute("align-items-desktop", t);
279
+ }
280
+ get placeContentDesktop() {
281
+ return this.getAttribute("place-content-desktop");
282
+ }
283
+ set placeContentDesktop(t) {
284
+ this.setAttribute("place-content-desktop", t);
285
+ }
286
+ get placeItemsDesktop() {
287
+ return this.getAttribute("place-items-desktop");
288
+ }
289
+ set placeItemsDesktop(t) {
290
+ this.setAttribute("place-items-desktop", t);
291
+ }
292
+ attributeChangedCallback(t, s, e) {
293
+ if (s !== e)
294
+ switch (t) {
295
+ case "gap":
296
+ this.updateAttribute(t, s, e, d);
297
+ break;
298
+ case "grid-cols":
299
+ case "grid-cols-mobile":
300
+ case "grid-cols-tablet":
301
+ case "grid-cols-laptop":
302
+ case "grid-cols-desktop":
303
+ this.updateAttribute(t, s, e, f);
304
+ break;
305
+ case "justify-content":
306
+ case "justify-items":
307
+ case "align-content":
308
+ case "align-items":
309
+ case "place-content":
310
+ case "place-items":
311
+ case "justify-content-mobile":
312
+ case "justify-items-mobile":
313
+ case "align-content-mobile":
314
+ case "align-items-mobile":
315
+ case "place-content-mobile":
316
+ case "place-items-mobile":
317
+ case "justify-content-tablet":
318
+ case "justify-items-tablet":
319
+ case "align-content-tablet":
320
+ case "align-items-tablet":
321
+ case "place-content-tablet":
322
+ case "place-items-tablet":
323
+ case "justify-content-laptop":
324
+ case "justify-items-laptop":
325
+ case "align-content-laptop":
326
+ case "align-items-laptop":
327
+ case "place-content-laptop":
328
+ case "place-items-laptop":
329
+ case "justify-content-desktop":
330
+ case "justify-items-desktop":
331
+ case "align-content-desktop":
332
+ case "align-items-desktop":
333
+ case "place-content-desktop":
334
+ case "place-items-desktop":
335
+ this.updateAttribute(t, s, e, m);
336
+ break;
337
+ default:
338
+ super.attributeChangedCallback(t, s, e);
339
+ break;
340
+ }
341
+ }
342
+ updateAttribute(t, s, e, p) {
343
+ this.checkName(p, e) ? t === "grid-cols" || t === "grid-cols-mobile" || t === "grid-cols-tablet" || t === "grid-cols-laptop" || t === "grid-cols-desktop" ? this.$el.style.setProperty(`--${t}`, e) : (s !== null && s !== "" && s !== "default" && this.$el.classList.toggle(`${t}-${s}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`${t}-${e}`)) : console.error(
344
+ `${e} is not an allowed ${t} value for ${this.$el}`
345
+ );
346
+ }
347
+ checkName(t, s) {
348
+ return t.includes(s);
349
+ }
350
+ };
351
+ a.nativeName = "div";
352
+ let n = a;
353
+ customElements.define("px-grid", n);
354
+ const i = class i extends n {
355
+ constructor() {
356
+ super(), this.template = () => `<div class="grid-item">
357
+ <slot></slot>
358
+ </div>`, this.shadowRoot.innerHTML = this.template();
359
+ }
360
+ static get observedAttributes() {
361
+ return [
362
+ ...super.observedAttributes,
363
+ "col-span",
364
+ "col-span-mobile",
365
+ "col-span-tablet",
366
+ "col-span-laptop",
367
+ "col-span-desktop",
368
+ "justify-self",
369
+ "align-self",
370
+ "place-self",
371
+ "justify-self-mobile",
372
+ "align-self-mobile",
373
+ "place-self-mobile",
374
+ "justify-self-tablet",
375
+ "align-self-tablet",
376
+ "place-self-tablet",
377
+ "justify-self-laptop",
378
+ "align-self-laptop",
379
+ "place-self-laptop",
380
+ "justify-self-desktop",
381
+ "align-self-desktop",
382
+ "place-self-desktop",
383
+ "order",
384
+ "order-mobile",
385
+ "order-tablet",
386
+ "order-laptop",
387
+ "order-desktop"
388
+ ];
389
+ }
390
+ get colSpan() {
391
+ return this.getAttribute("col-span");
392
+ }
393
+ set colSpan(t) {
394
+ this.setAttribute("col-span", t);
395
+ }
396
+ get colSpanMobile() {
397
+ return this.getAttribute("col-span-mobile");
398
+ }
399
+ set colSpanMobile(t) {
400
+ this.setAttribute("col-span-mobile", t);
401
+ }
402
+ get colSpanTablet() {
403
+ return this.getAttribute("col-span-tablet");
404
+ }
405
+ set colSpanTablet(t) {
406
+ this.setAttribute("col-span-tablet", t);
407
+ }
408
+ get colSpanLaptop() {
409
+ return this.getAttribute("col-span-laptop");
410
+ }
411
+ set colSpanLaptop(t) {
412
+ this.setAttribute("col-span-laptop", t);
413
+ }
414
+ get colSpanDesktop() {
415
+ return this.getAttribute("col-span-desktop");
416
+ }
417
+ set colSpanDesktop(t) {
418
+ this.setAttribute("col-span-desktop", t);
419
+ }
420
+ get justifySelf() {
421
+ return this.getAttribute("justify-self");
422
+ }
423
+ set justifySelf(t) {
424
+ this.setAttribute("justify-self", t);
425
+ }
426
+ get alignSelf() {
427
+ return this.getAttribute("align-self");
428
+ }
429
+ set alignSelf(t) {
430
+ this.setAttribute("align-self", t);
431
+ }
432
+ get placeSelf() {
433
+ return this.getAttribute("place-self");
434
+ }
435
+ set placeSelf(t) {
436
+ this.setAttribute("place-self", t);
437
+ }
438
+ get justifySelfMobile() {
439
+ return this.getAttribute("justify-self-mobile");
440
+ }
441
+ set justifySelfMobile(t) {
442
+ this.setAttribute("justify-self-mobile", t);
443
+ }
444
+ get alignSelfMobile() {
445
+ return this.getAttribute("align-self-mobile");
446
+ }
447
+ set alignSelfMobile(t) {
448
+ this.setAttribute("align-self-mobile", t);
449
+ }
450
+ get placeSelfMobile() {
451
+ return this.getAttribute("place-self-mobile");
452
+ }
453
+ set placeSelfMobile(t) {
454
+ this.setAttribute("place-self-mobile", t);
455
+ }
456
+ get justifySelfTablet() {
457
+ return this.getAttribute("justify-self-tablet");
458
+ }
459
+ set justifySelfTablet(t) {
460
+ this.setAttribute("justify-self-tablet", t);
461
+ }
462
+ get alignSelfTablet() {
463
+ return this.getAttribute("align-self-tablet");
464
+ }
465
+ set alignSelfTablet(t) {
466
+ this.setAttribute("align-self-tablet", t);
467
+ }
468
+ get placeSelfTablet() {
469
+ return this.getAttribute("place-self-tablet");
470
+ }
471
+ set placeSelfTablet(t) {
472
+ this.setAttribute("place-self-tablet", t);
473
+ }
474
+ get justifySelfLaptop() {
475
+ return this.getAttribute("justify-self-laptop");
476
+ }
477
+ set justifySelfLaptop(t) {
478
+ this.setAttribute("justify-self-laptop", t);
479
+ }
480
+ get alignSelfLaptop() {
481
+ return this.getAttribute("align-self-laptop");
482
+ }
483
+ set alignSelfLaptop(t) {
484
+ this.setAttribute("align-self-laptop", t);
485
+ }
486
+ get placeSelfLaptop() {
487
+ return this.getAttribute("place-self-laptop");
488
+ }
489
+ set placeSelfLaptop(t) {
490
+ this.setAttribute("place-self-laptop", t);
491
+ }
492
+ get justifySelfDesktop() {
493
+ return this.getAttribute("justify-self-desktop");
494
+ }
495
+ set justifySelfDesktop(t) {
496
+ this.setAttribute("justify-self-desktop", t);
497
+ }
498
+ get alignSelfDesktop() {
499
+ return this.getAttribute("align-self-desktop");
500
+ }
501
+ set alignSelfDesktop(t) {
502
+ this.setAttribute("align-self-desktop", t);
503
+ }
504
+ get placeSelfDesktop() {
505
+ return this.getAttribute("place-self-desktop");
506
+ }
507
+ set placeSelfDesktop(t) {
508
+ this.setAttribute("place-self-desktop", t);
509
+ }
510
+ get order() {
511
+ return this.getAttribute("order");
512
+ }
513
+ set order(t) {
514
+ this.setAttribute("order", t);
515
+ }
516
+ get orderMobile() {
517
+ return this.getAttribute("order-mobile");
518
+ }
519
+ set orderMobile(t) {
520
+ this.setAttribute("order-mobile", t);
521
+ }
522
+ get orderTablet() {
523
+ return this.getAttribute("order-tablet");
524
+ }
525
+ set orderTablet(t) {
526
+ this.setAttribute("order-tablet", t);
527
+ }
528
+ get orderLaptop() {
529
+ return this.getAttribute("order-laptop");
530
+ }
531
+ set orderLaptop(t) {
532
+ this.setAttribute("order-laptop", t);
533
+ }
534
+ get orderDesktop() {
535
+ return this.getAttribute("order-desktop");
536
+ }
537
+ set orderDesktop(t) {
538
+ this.setAttribute("order-desktop", t);
539
+ }
540
+ };
541
+ i.nativeName = "div";
542
+ let l = i;
543
+ customElements.define("px-grid-item", l);
544
+ export {
545
+ n as Grid,
546
+ l as GridItem
547
+ };
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@proximus/lavender-grid",
3
+ "version": "1.0.0-alpha.4",
4
+ "description": "",
5
+ "main": "src/index.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "type": "module",
10
+ "scripts": {
11
+ "build": "tsc; vite build",
12
+ "test": "vitest run --coverage"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "lerna": {
18
+ "command": {
19
+ "publish": {
20
+ "assets": [
21
+ "CHANGELOG.md",
22
+ "package.json",
23
+ "dist/*.js",
24
+ "dist/css/**/*.css"
25
+ ]
26
+ }
27
+ }
28
+ },
29
+ "gitHead": "15a231df98020f83813279639a9a7712a5a5e759"
30
+ }