@ulu/frontend 0.1.0-beta.40 → 0.1.0-beta.42
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.
- package/CHANGELOG.md +12 -0
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +1 -1
- package/docs-dev/changelog/index.html +11 -0
- package/docs-dev/demos/card/index.html +16 -16
- package/docs-dev/demos/data-table/index.html +100 -100
- package/docs-dev/demos/popovers/index.html +0 -5453
- package/docs-dev/javascript/utils-dom/index.html +24 -12
- package/js/utils/dom.js +19 -7
- package/package.json +1 -1
- package/scss/components/_card.scss +2 -2
- package/types/utils/dom.d.ts +12 -5
- package/types/utils/dom.d.ts.map +1 -1
|
@@ -5190,7 +5190,7 @@
|
|
|
5190
5190
|
<li><a href="#utils%2Fdom.resolveclasses(input)-%E2%87%92-array.%3Cstring%3E">utils/dom.resolveClasses(input) ⇒ Array.<string></string></a>
|
|
5191
5191
|
</li>
|
|
5192
5192
|
|
|
5193
|
-
<li><a href="#utils%2Fdom.addscrollbarproperty(
|
|
5193
|
+
<li><a href="#utils%2Fdom.addscrollbarproperty(options)">utils/dom.addScrollbarProperty(options)</a>
|
|
5194
5194
|
</li>
|
|
5195
5195
|
|
|
5196
5196
|
<li><a href="#utils%2Fdom.getscrollbarwidth(%5Belement%5D%2C-%5Bcontainer%5D)-%E2%87%92-number">utils/dom.getScrollbarWidth([element], [container]) ⇒ number</a>
|
|
@@ -5219,7 +5219,7 @@
|
|
|
5219
5219
|
<li><a href="#module_utils/dom.getElement">.getElement(target, context)</a> ⇒ <code>HTMLElement</code></li>
|
|
5220
5220
|
<li><a href="#module_utils/dom.getElements">.getElements(target, context)</a> ⇒ <code>Array</code></li>
|
|
5221
5221
|
<li><a href="#module_utils/dom.resolveClasses">.resolveClasses(input)</a> ⇒ <code>Array.<string></code></li>
|
|
5222
|
-
<li><a href="#module_utils/dom.addScrollbarProperty">.addScrollbarProperty(
|
|
5222
|
+
<li><a href="#module_utils/dom.addScrollbarProperty">.addScrollbarProperty(options)</a></li>
|
|
5223
5223
|
<li><a href="#module_utils/dom.getScrollbarWidth">.getScrollbarWidth([element], [container])</a> ⇒ <code>number</code></li>
|
|
5224
5224
|
</ul>
|
|
5225
5225
|
</li>
|
|
@@ -5414,8 +5414,8 @@ or new instances are added to the screen</p>
|
|
|
5414
5414
|
<span class="pjs-token pjs-function">resolveClassArray</span><span class="pjs-token pjs-punctuation">(</span><span class="pjs-token pjs-punctuation">[</span><span class="pjs-token pjs-string">"another-class"</span><span class="pjs-token pjs-punctuation">,</span> <span class="pjs-token pjs-string">"yet-another-class"</span><span class="pjs-token pjs-punctuation">]</span><span class="pjs-token pjs-punctuation">)</span><span class="pjs-token pjs-punctuation">;</span> <span class="pjs-token pjs-comment">// Returns ["another-class", "yet-another-class"]</span>
|
|
5415
5415
|
<span class="pjs-token pjs-function">resolveClassArray</span><span class="pjs-token pjs-punctuation">(</span><span class="pjs-token pjs-string">"single-class"</span><span class="pjs-token pjs-punctuation">)</span><span class="pjs-token pjs-punctuation">;</span> <span class="pjs-token pjs-comment">// Returns ["single-class"]</span></code></pre>
|
|
5416
5416
|
<p><a name="module_utils/dom.addScrollbarProperty"></a></p>
|
|
5417
|
-
<h2 id="utils%2Fdom.addscrollbarproperty(
|
|
5418
|
-
<p>Sets a CSS custom property equal to the scrollbar width
|
|
5417
|
+
<h2 id="utils%2Fdom.addscrollbarproperty(options)" tabindex="-1">utils/dom.addScrollbarProperty(options)</h2>
|
|
5418
|
+
<p>Sets a CSS custom property equal to the scrollbar width.</p>
|
|
5419
5419
|
<p><strong>Kind</strong>: static method of <a href="#module_utils/dom"><code>utils/dom</code></a></p>
|
|
5420
5420
|
<table>
|
|
5421
5421
|
<thead>
|
|
@@ -5428,22 +5428,34 @@ or new instances are added to the screen</p>
|
|
|
5428
5428
|
</thead>
|
|
5429
5429
|
<tbody>
|
|
5430
5430
|
<tr>
|
|
5431
|
-
<td>
|
|
5431
|
+
<td>options</td>
|
|
5432
|
+
<td><code>object</code></td>
|
|
5433
|
+
<td></td>
|
|
5434
|
+
<td>Configuration options.</td>
|
|
5435
|
+
</tr>
|
|
5436
|
+
<tr>
|
|
5437
|
+
<td>[options.scrollableChild]</td>
|
|
5432
5438
|
<td><code>HTMLElement</code></td>
|
|
5433
5439
|
<td><code>document.body</code></td>
|
|
5434
|
-
<td>
|
|
5440
|
+
<td>An element that is a child of a scrollable container (used for width calculation).</td>
|
|
5435
5441
|
</tr>
|
|
5436
5442
|
<tr>
|
|
5437
|
-
<td>[container]</td>
|
|
5443
|
+
<td>[options.container]</td>
|
|
5438
5444
|
<td><code>Window</code> | <code>HTMLElement</code></td>
|
|
5439
5445
|
<td><code>window</code></td>
|
|
5440
|
-
<td>The container that can be scrolled
|
|
5446
|
+
<td>The container that can be scrolled (used for width calculation).</td>
|
|
5441
5447
|
</tr>
|
|
5442
5448
|
<tr>
|
|
5443
|
-
<td>
|
|
5444
|
-
<td><code>
|
|
5445
|
-
<td></td>
|
|
5446
|
-
<td>
|
|
5449
|
+
<td>[options.propertyElement]</td>
|
|
5450
|
+
<td><code>HTMLElement</code></td>
|
|
5451
|
+
<td><code>document.documentElement</code></td>
|
|
5452
|
+
<td>The element to which the custom property will be added. Defaults to document.documentElement for :root access.</td>
|
|
5453
|
+
</tr>
|
|
5454
|
+
<tr>
|
|
5455
|
+
<td>[options.propName]</td>
|
|
5456
|
+
<td><code>string</code></td>
|
|
5457
|
+
<td><code>"&quot;--ulu-scrollbar-width&quot;"</code></td>
|
|
5458
|
+
<td>The name of the custom property to set.</td>
|
|
5447
5459
|
</tr>
|
|
5448
5460
|
</tbody>
|
|
5449
5461
|
</table>
|
package/js/utils/dom.js
CHANGED
|
@@ -165,14 +165,26 @@ export function resolveClasses(classes) {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
|
-
* Sets a CSS custom property equal to the scrollbar width
|
|
169
|
-
* @param {
|
|
170
|
-
* @param {
|
|
171
|
-
* @param {
|
|
168
|
+
* Sets a CSS custom property equal to the scrollbar width.
|
|
169
|
+
* @param {object} options - Configuration options.
|
|
170
|
+
* @param {HTMLElement} [options.scrollableChild=document.body] - An element that is a child of a scrollable container (used for width calculation).
|
|
171
|
+
* @param {Window|HTMLElement} [options.container=window] - The container that can be scrolled (used for width calculation).
|
|
172
|
+
* @param {HTMLElement} [options.propertyElement=document.documentElement] - The element to which the custom property will be added. Defaults to document.documentElement for :root access.
|
|
173
|
+
* @param {string} [options.propName="--ulu-scrollbar-width"] - The name of the custom property to set.
|
|
172
174
|
*/
|
|
173
|
-
export function addScrollbarProperty(
|
|
174
|
-
const
|
|
175
|
-
|
|
175
|
+
export function addScrollbarProperty(options) {
|
|
176
|
+
const defaults = {
|
|
177
|
+
scrollableChild: document.body,
|
|
178
|
+
container: window,
|
|
179
|
+
propertyElement: document.documentElement,
|
|
180
|
+
propName: "--ulu-scrollbar-width",
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const config = { ...defaults, ...options };
|
|
184
|
+
const { scrollableChild, container, propertyElement, propName } = config;
|
|
185
|
+
|
|
186
|
+
const scrollbarWidth = getScrollbarWidth(scrollableChild, container);
|
|
187
|
+
propertyElement.style.setProperty(propName, `${ scrollbarWidth }px`);
|
|
176
188
|
}
|
|
177
189
|
|
|
178
190
|
/**
|
package/package.json
CHANGED
|
@@ -125,8 +125,8 @@ $config: (
|
|
|
125
125
|
// new below
|
|
126
126
|
"toggle-aside-rule" : true,
|
|
127
127
|
"aside-rule-width" : 6px,
|
|
128
|
-
"aside-background-color" :
|
|
129
|
-
"aside-rule-color":
|
|
128
|
+
"aside-background-color" : transparent,
|
|
129
|
+
"aside-rule-color": "rule",
|
|
130
130
|
|
|
131
131
|
) !default;
|
|
132
132
|
|
package/types/utils/dom.d.ts
CHANGED
|
@@ -59,12 +59,19 @@ export function getElements(target: string | Node, context?: any): any[];
|
|
|
59
59
|
*/
|
|
60
60
|
export function resolveClasses(classes: any): string[];
|
|
61
61
|
/**
|
|
62
|
-
* Sets a CSS custom property equal to the scrollbar width
|
|
63
|
-
* @param {
|
|
64
|
-
* @param {
|
|
65
|
-
* @param {
|
|
62
|
+
* Sets a CSS custom property equal to the scrollbar width.
|
|
63
|
+
* @param {object} options - Configuration options.
|
|
64
|
+
* @param {HTMLElement} [options.scrollableChild=document.body] - An element that is a child of a scrollable container (used for width calculation).
|
|
65
|
+
* @param {Window|HTMLElement} [options.container=window] - The container that can be scrolled (used for width calculation).
|
|
66
|
+
* @param {HTMLElement} [options.propertyElement=document.documentElement] - The element to which the custom property will be added. Defaults to document.documentElement for :root access.
|
|
67
|
+
* @param {string} [options.propName="--ulu-scrollbar-width"] - The name of the custom property to set.
|
|
66
68
|
*/
|
|
67
|
-
export function addScrollbarProperty(
|
|
69
|
+
export function addScrollbarProperty(options: {
|
|
70
|
+
scrollableChild?: HTMLElement;
|
|
71
|
+
container?: Window | HTMLElement;
|
|
72
|
+
propertyElement?: HTMLElement;
|
|
73
|
+
propName?: string;
|
|
74
|
+
}): void;
|
|
68
75
|
/**
|
|
69
76
|
* Calculates the width of the scrollbar.
|
|
70
77
|
*
|
package/types/utils/dom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../js/utils/dom.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,2DAFa,MAAM,CAOlB;AAED;;;;;GAKG;AACH,wCAJW,IAAI,oBAYd;AAED;;;;;;GAMG;AACH,gDAJW,IAAI,gBAEF,YAAa,CASzB;AAED;;GAEG;AACH,mEAMC;AAGD;;;;;;;;;GASG;AACH,2CAHa,IAAI,uBAoChB;AAED;;;;;GAKG;AACH,mCAJW,SAAO,IAAI,kBAEV,WAAW,CAWtB;AAED;;;;;GAKG;AACH,oCAJW,SAAO,IAAI,wBAerB;AAED;;;;;;;;GAQG;AACH,8CANa,MAAM,EAAE,CAiBpB;AAED
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../js/utils/dom.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,2DAFa,MAAM,CAOlB;AAED;;;;;GAKG;AACH,wCAJW,IAAI,oBAYd;AAED;;;;;;GAMG;AACH,gDAJW,IAAI,gBAEF,YAAa,CASzB;AAED;;GAEG;AACH,mEAMC;AAGD;;;;;;;;;GASG;AACH,2CAHa,IAAI,uBAoChB;AAED;;;;;GAKG;AACH,mCAJW,SAAO,IAAI,kBAEV,WAAW,CAWtB;AAED;;;;;GAKG;AACH,oCAJW,SAAO,IAAI,wBAerB;AAED;;;;;;;;GAQG;AACH,8CANa,MAAM,EAAE,CAiBpB;AAED;;;;;;;GAOG;AACH;IALiC,eAAe,GAArC,WAAW;IACkB,SAAS,GAAtC,MAAM,GAAC,WAAW;IACI,eAAe,GAArC,WAAW;IACM,QAAQ,GAAzB,MAAM;SAehB;AAED;;;;;;GAMG;AACH,4CAJW,WAAW,cACX,MAAM,GAAC,WAAW,GAChB,MAAM,CAIlB;AAtMD;;GAEG;AAGH,qCAAqD"}
|