@pine-ds/core 1.0.3 → 1.0.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.
- package/components/custom-elements.d.ts +2 -0
- package/components/index.d.ts +92 -0
- package/components/index.js +32 -0
- package/components/index.js.map +1 -0
- package/components/index2.js +14 -0
- package/components/index2.js.map +1 -0
- package/components/package.json +9 -0
- package/components/pds-accordion.d.ts +11 -0
- package/components/pds-accordion.js +74 -0
- package/components/pds-accordion.js.map +1 -0
- package/components/pds-avatar.d.ts +11 -0
- package/components/pds-avatar.js +103 -0
- package/components/pds-avatar.js.map +1 -0
- package/components/pds-box.d.ts +11 -0
- package/components/pds-box.js +124 -0
- package/components/pds-box.js.map +1 -0
- package/components/pds-button.d.ts +11 -0
- package/components/pds-button.js +8 -0
- package/components/pds-button.js.map +1 -0
- package/components/pds-button2.js +84 -0
- package/components/pds-button2.js.map +1 -0
- package/components/pds-checkbox.d.ts +11 -0
- package/components/pds-checkbox.js +8 -0
- package/components/pds-checkbox.js.map +1 -0
- package/components/pds-checkbox2.js +86 -0
- package/components/pds-checkbox2.js.map +1 -0
- package/components/pds-chip.d.ts +11 -0
- package/components/pds-chip.js +78 -0
- package/components/pds-chip.js.map +1 -0
- package/components/pds-copytext.d.ts +11 -0
- package/components/pds-copytext.js +88 -0
- package/components/pds-copytext.js.map +1 -0
- package/components/pds-divider.d.ts +11 -0
- package/components/pds-divider.js +54 -0
- package/components/pds-divider.js.map +1 -0
- package/components/pds-icon.js +8 -0
- package/components/pds-icon.js.map +1 -0
- package/components/pds-icon2.js +359 -0
- package/components/pds-icon2.js.map +1 -0
- package/components/pds-image.d.ts +11 -0
- package/components/pds-image.js +55 -0
- package/components/pds-image.js.map +1 -0
- package/components/pds-input.d.ts +11 -0
- package/components/pds-input.js +72 -0
- package/components/pds-input.js.map +1 -0
- package/components/pds-label.js +39 -0
- package/components/pds-label.js.map +1 -0
- package/components/pds-link.d.ts +11 -0
- package/components/pds-link.js +65 -0
- package/components/pds-link.js.map +1 -0
- package/components/pds-progress.d.ts +11 -0
- package/components/pds-progress.js +49 -0
- package/components/pds-progress.js.map +1 -0
- package/components/pds-radio.d.ts +11 -0
- package/components/pds-radio.js +78 -0
- package/components/pds-radio.js.map +1 -0
- package/components/pds-row.d.ts +11 -0
- package/components/pds-row.js +72 -0
- package/components/pds-row.js.map +1 -0
- package/components/pds-sortable-item.d.ts +11 -0
- package/components/pds-sortable-item.js +58 -0
- package/components/pds-sortable-item.js.map +1 -0
- package/components/pds-sortable.d.ts +11 -0
- package/components/pds-sortable.js +2722 -0
- package/components/pds-sortable.js.map +1 -0
- package/components/pds-switch.d.ts +11 -0
- package/components/pds-switch.js +82 -0
- package/components/pds-switch.js.map +1 -0
- package/components/pds-tab.d.ts +11 -0
- package/components/pds-tab.js +53 -0
- package/components/pds-tab.js.map +1 -0
- package/components/pds-table-body.d.ts +11 -0
- package/components/pds-table-body.js +36 -0
- package/components/pds-table-body.js.map +1 -0
- package/components/pds-table-cell.d.ts +11 -0
- package/components/pds-table-cell.js +8 -0
- package/components/pds-table-cell.js.map +1 -0
- package/components/pds-table-cell2.js +72 -0
- package/components/pds-table-cell2.js.map +1 -0
- package/components/pds-table-head-cell.d.ts +11 -0
- package/components/pds-table-head-cell.js +8 -0
- package/components/pds-table-head-cell.js.map +1 -0
- package/components/pds-table-head-cell2.js +96 -0
- package/components/pds-table-head-cell2.js.map +1 -0
- package/components/pds-table-head.d.ts +11 -0
- package/components/pds-table-head.js +56 -0
- package/components/pds-table-head.js.map +1 -0
- package/components/pds-table-row.d.ts +11 -0
- package/components/pds-table-row.js +78 -0
- package/components/pds-table-row.js.map +1 -0
- package/components/pds-table.d.ts +11 -0
- package/components/pds-table.js +100 -0
- package/components/pds-table.js.map +1 -0
- package/components/pds-tabpanel.d.ts +11 -0
- package/components/pds-tabpanel.js +45 -0
- package/components/pds-tabpanel.js.map +1 -0
- package/components/pds-tabs.d.ts +11 -0
- package/components/pds-tabs.js +119 -0
- package/components/pds-tabs.js.map +1 -0
- package/components/pds-textarea.d.ts +11 -0
- package/components/pds-textarea.js +82 -0
- package/components/pds-textarea.js.map +1 -0
- package/components/pds-tooltip.d.ts +11 -0
- package/components/pds-tooltip.js +178 -0
- package/components/pds-tooltip.js.map +1 -0
- package/dist/docs.json +1 -1
- package/hydrate/index.d.ts +218 -0
- package/hydrate/index.js +13120 -0
- package/hydrate/package.json +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { Build, proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
let missingAssetPathWarning = false;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Reads the component asset path config from meta tag or a global variable.
|
|
7
|
+
* This is a temporary workaround until these issues have been addressed:
|
|
8
|
+
*
|
|
9
|
+
* https://github.com/ionic-team/stencil/issues/2826/
|
|
10
|
+
* https://github.com/ionic-team/stencil/issues/3470
|
|
11
|
+
* https://github.com/ionic-team/stencil-ds-output-targets/issues/186
|
|
12
|
+
*/
|
|
13
|
+
const getAssetPath = (path) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const metaPineAssetPath = (_a = document.head.querySelector('meta[data-pine-asset-path]')) === null || _a === void 0 ? void 0 : _a.dataset.pineAssetPath;
|
|
16
|
+
// Get the asset path from the window object if available
|
|
17
|
+
const windowAssetPath = window.__PINE_ASSET_PATH__;
|
|
18
|
+
// Set the CDN Asset path using the latest version
|
|
19
|
+
const cdnAssetPath = 'https://cdn.jsdelivr.net/npm/@pine-ds/icons/dist/pds-icons/';
|
|
20
|
+
const assetBasePath = Build.isTesting ? '/dist/pds-icons' : metaPineAssetPath || windowAssetPath || cdnAssetPath || '/';
|
|
21
|
+
// Display a warning if the assets are fetched from the CDN.
|
|
22
|
+
if (assetBasePath.startsWith('https://cdn.jsdelivr.net/npm/') && !missingAssetPathWarning) {
|
|
23
|
+
missingAssetPathWarning = true;
|
|
24
|
+
console.warn(`
|
|
25
|
+
Fetching Pine asssets from jsDelivr CDN.\n\n It's recommended that you bundle Pine Assets with your application and setting the path accordingly.\n\nFor more information you read the documentation: \nhttps://pine-design-system.netlify.app/?path=/docs/resources-assets--docs
|
|
26
|
+
`);
|
|
27
|
+
}
|
|
28
|
+
let assetPath = path;
|
|
29
|
+
if (path.startsWith('./')) {
|
|
30
|
+
assetPath = path.substring(2);
|
|
31
|
+
}
|
|
32
|
+
if (!assetBasePath.endsWith('/')) {
|
|
33
|
+
assetPath = '/' + assetPath;
|
|
34
|
+
}
|
|
35
|
+
return assetBasePath + assetPath;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
let CACHED_MAP;
|
|
39
|
+
const getIconMap = () => {
|
|
40
|
+
if (typeof window === 'undefined') {
|
|
41
|
+
return new Map();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (!CACHED_MAP) {
|
|
45
|
+
const win = window; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
46
|
+
win.PdsIcons = win.PdsIcons || {};
|
|
47
|
+
CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();
|
|
48
|
+
}
|
|
49
|
+
return CACHED_MAP;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const getName = (iconName, icon) => {
|
|
53
|
+
if (!iconName && icon && !isSrc(icon)) {
|
|
54
|
+
iconName = icon;
|
|
55
|
+
}
|
|
56
|
+
if (isStr(iconName)) {
|
|
57
|
+
iconName = toLower(iconName);
|
|
58
|
+
}
|
|
59
|
+
if (!isStr(iconName) || iconName.trim() === '') {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
|
|
63
|
+
if (invalidChars != '') {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return iconName;
|
|
67
|
+
};
|
|
68
|
+
const getNamedUrl = (iconName) => {
|
|
69
|
+
const url = getIconMap().get(iconName);
|
|
70
|
+
if (url) {
|
|
71
|
+
return url;
|
|
72
|
+
}
|
|
73
|
+
return getAssetPath(`svg/${iconName}.svg`);
|
|
74
|
+
};
|
|
75
|
+
const getSrc = (src) => {
|
|
76
|
+
if (isStr(src)) {
|
|
77
|
+
src = src.trim();
|
|
78
|
+
if (isSrc(src)) {
|
|
79
|
+
return src;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
};
|
|
84
|
+
const getUrl = (pdsIcon) => {
|
|
85
|
+
let url = getSrc(pdsIcon.src);
|
|
86
|
+
if (url) {
|
|
87
|
+
return url;
|
|
88
|
+
}
|
|
89
|
+
url = getName(pdsIcon.name, pdsIcon.icon);
|
|
90
|
+
if (url) {
|
|
91
|
+
return getNamedUrl(url);
|
|
92
|
+
}
|
|
93
|
+
if (pdsIcon.icon) {
|
|
94
|
+
url = getSrc(pdsIcon.icon);
|
|
95
|
+
if (url) {
|
|
96
|
+
return url;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
};
|
|
101
|
+
const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
|
102
|
+
const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
103
|
+
const toLower = (val) => val.toLowerCase();
|
|
104
|
+
/**
|
|
105
|
+
* Elements inside of web components sometimes need to inherit global attributes
|
|
106
|
+
* set on the host. For example, the inner input in `ion-input` should inherit
|
|
107
|
+
* the `title` attribute that developers set directly on `ion-input`. This
|
|
108
|
+
* helper function should be called in componentWillLoad and assigned to a variable
|
|
109
|
+
* that is later used in the render function.
|
|
110
|
+
*
|
|
111
|
+
* This does not need to be reactive as changing attributes on the host element
|
|
112
|
+
* does not trigger a re-render.
|
|
113
|
+
*/
|
|
114
|
+
const inheritAttributes = (el, attributes = []) => {
|
|
115
|
+
const attributeObject = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
116
|
+
attributes.forEach(attr => {
|
|
117
|
+
if (el.hasAttribute(attr)) {
|
|
118
|
+
const value = el.getAttribute(attr);
|
|
119
|
+
if (value !== null) {
|
|
120
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
121
|
+
}
|
|
122
|
+
el.removeAttribute(attr);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return attributeObject;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const validateContent = (svgContent) => {
|
|
129
|
+
const div = document.createElement('div');
|
|
130
|
+
div.innerHTML = svgContent;
|
|
131
|
+
// setup this way to ensure it works on our buddy IE
|
|
132
|
+
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
|
133
|
+
if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
|
|
134
|
+
div.removeChild(div.childNodes[i]);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// must only have 1 root element
|
|
138
|
+
const svgElm = div.firstElementChild;
|
|
139
|
+
if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
|
|
140
|
+
const svgClass = svgElm.getAttribute('class') || '';
|
|
141
|
+
svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());
|
|
142
|
+
// root element must be an svg
|
|
143
|
+
// lets double check we've got valid elements
|
|
144
|
+
// do not allow scripts
|
|
145
|
+
if (isValid(svgElm)) {
|
|
146
|
+
return div.innerHTML;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return '';
|
|
150
|
+
};
|
|
151
|
+
const isValid = (elm) => {
|
|
152
|
+
if (elm.nodeType === 1) {
|
|
153
|
+
if (elm.nodeName.toLowerCase() === 'script') {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
for (let i = 0; i < elm.attributes.length; i++) {
|
|
157
|
+
const name = elm.attributes[i].name;
|
|
158
|
+
if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
for (let i = 0; i < elm.childNodes.length; i++) {
|
|
163
|
+
if (!isValid(elm.childNodes[i])) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return true;
|
|
169
|
+
};
|
|
170
|
+
const isSvgDataUrl = (url) => url.startsWith('data:image/svg+xml');
|
|
171
|
+
const isEncodedDataUrl = (url) => url.indexOf(';utf8,') !== -1;
|
|
172
|
+
|
|
173
|
+
const pdsIconContent = new Map();
|
|
174
|
+
const requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
175
|
+
let parser;
|
|
176
|
+
const getSvgContent = (url, sanitize = false) => {
|
|
177
|
+
let req = requests.get(url);
|
|
178
|
+
if (!req) {
|
|
179
|
+
if (typeof fetch != 'undefined' && typeof document !== 'undefined') {
|
|
180
|
+
if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {
|
|
181
|
+
if (!parser) {
|
|
182
|
+
parser = new DOMParser();
|
|
183
|
+
}
|
|
184
|
+
const doc = parser.parseFromString(url, 'text/html');
|
|
185
|
+
const svg = doc.querySelector('svg');
|
|
186
|
+
if (svg) {
|
|
187
|
+
pdsIconContent.set(url, svg.outerHTML);
|
|
188
|
+
}
|
|
189
|
+
return Promise.resolve();
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// we don't have a request
|
|
193
|
+
req = fetch(url).then((rsp) => {
|
|
194
|
+
if (rsp.ok) {
|
|
195
|
+
return rsp.text().then((svgContent) => {
|
|
196
|
+
if (svgContent && sanitize !== false) {
|
|
197
|
+
svgContent = validateContent(svgContent);
|
|
198
|
+
}
|
|
199
|
+
pdsIconContent.set(url, svgContent || '');
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
pdsIconContent.set(url, '');
|
|
203
|
+
});
|
|
204
|
+
requests.set(url, req);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
pdsIconContent.set(url, '');
|
|
209
|
+
return Promise.resolve();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return req;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const pdsIconCss = ":host{contain:strict;display:inline-block;fill:currentColor;height:1em;width:1em}:host .pdsicon{fill:currentColor}.pds-icon-fill-none{fill:none}.icon-inner,.pds-icon,svg{display:block;height:100%;width:100%}";
|
|
216
|
+
const PdsIconStyle0 = pdsIconCss;
|
|
217
|
+
|
|
218
|
+
const PdsIcon = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLElement {
|
|
219
|
+
constructor() {
|
|
220
|
+
super();
|
|
221
|
+
this.__registerHost();
|
|
222
|
+
this.__attachShadow();
|
|
223
|
+
this.inheritedAttributes = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
224
|
+
this.hasAriaHidden = () => {
|
|
225
|
+
const { el } = this;
|
|
226
|
+
return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';
|
|
227
|
+
};
|
|
228
|
+
this.ariaLabel = undefined;
|
|
229
|
+
this.isVisible = false;
|
|
230
|
+
this.svgContent = undefined;
|
|
231
|
+
this.color = undefined;
|
|
232
|
+
this.icon = undefined;
|
|
233
|
+
this.name = undefined;
|
|
234
|
+
this.size = 'regular';
|
|
235
|
+
this.src = undefined;
|
|
236
|
+
}
|
|
237
|
+
iconSize() {
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
239
|
+
const sizes = {
|
|
240
|
+
small: '12px',
|
|
241
|
+
regular: '16px',
|
|
242
|
+
medium: '20px',
|
|
243
|
+
large: '24px',
|
|
244
|
+
};
|
|
245
|
+
if (sizes[this.size]) {
|
|
246
|
+
return sizes[this.size];
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
return this.size;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
componentWillLoad() {
|
|
253
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
254
|
+
}
|
|
255
|
+
connectedCallback() {
|
|
256
|
+
this.waitUntilVisible(this.el, '50px', () => {
|
|
257
|
+
this.isVisible = true;
|
|
258
|
+
this.loadIcon();
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
disconnectedCallback() {
|
|
262
|
+
if (this.io) {
|
|
263
|
+
this.io.disconnect();
|
|
264
|
+
this.io = undefined;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
loadIcon() {
|
|
268
|
+
if (Build.isBrowser && this.isVisible) {
|
|
269
|
+
const url = getUrl(this);
|
|
270
|
+
if (url) {
|
|
271
|
+
if (pdsIconContent.has(url)) {
|
|
272
|
+
this.svgContent = pdsIconContent.get(url);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const label = getName(this.name, this.icon);
|
|
280
|
+
if (label) {
|
|
281
|
+
this.ariaLabel = label.replace(/\-/g, ' ');
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
render() {
|
|
285
|
+
const { ariaLabel, inheritedAttributes } = this;
|
|
286
|
+
const style = {
|
|
287
|
+
height: this.iconSize(),
|
|
288
|
+
width: this.iconSize(),
|
|
289
|
+
color: this.color,
|
|
290
|
+
};
|
|
291
|
+
return (h(Host, Object.assign({ key: '450a12ddbe225916752aeb9323ff1a11d11bc4b3', "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: "img", style: style, class: Object.assign({}, createColorClasses(this.color)) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
|
|
292
|
+
}
|
|
293
|
+
/*****
|
|
294
|
+
* Private Methods
|
|
295
|
+
****/
|
|
296
|
+
waitUntilVisible(el, rootMargin, cb) {
|
|
297
|
+
if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {
|
|
298
|
+
const io = (this.io = new (window).IntersectionObserver((data) => {
|
|
299
|
+
if (data[0].isIntersecting) {
|
|
300
|
+
io.disconnect();
|
|
301
|
+
this.io = undefined;
|
|
302
|
+
cb();
|
|
303
|
+
}
|
|
304
|
+
}, { rootMargin }));
|
|
305
|
+
io.observe(el);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
// browser doesn't support IntersectionObserver
|
|
309
|
+
// so just fallback to always show it
|
|
310
|
+
cb();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
static get assetsDirs() { return ["svg"]; }
|
|
314
|
+
get el() { return this; }
|
|
315
|
+
static get watchers() { return {
|
|
316
|
+
"name": ["loadIcon"],
|
|
317
|
+
"src": ["loadIcon"],
|
|
318
|
+
"icon": ["loadIcon"]
|
|
319
|
+
}; }
|
|
320
|
+
static get style() { return PdsIconStyle0; }
|
|
321
|
+
}, [1, "pds-icon", {
|
|
322
|
+
"color": [1],
|
|
323
|
+
"icon": [8],
|
|
324
|
+
"name": [513],
|
|
325
|
+
"size": [513],
|
|
326
|
+
"src": [1],
|
|
327
|
+
"ariaLabel": [32],
|
|
328
|
+
"isVisible": [32],
|
|
329
|
+
"svgContent": [32]
|
|
330
|
+
}, undefined, {
|
|
331
|
+
"name": ["loadIcon"],
|
|
332
|
+
"src": ["loadIcon"],
|
|
333
|
+
"icon": ["loadIcon"]
|
|
334
|
+
}]);
|
|
335
|
+
const createColorClasses = (color) => {
|
|
336
|
+
return color
|
|
337
|
+
? {
|
|
338
|
+
'pds-color': true,
|
|
339
|
+
[`pds-color-${color}`]: true,
|
|
340
|
+
}
|
|
341
|
+
: null;
|
|
342
|
+
};
|
|
343
|
+
function defineCustomElement() {
|
|
344
|
+
if (typeof customElements === "undefined") {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const components = ["pds-icon"];
|
|
348
|
+
components.forEach(tagName => { switch (tagName) {
|
|
349
|
+
case "pds-icon":
|
|
350
|
+
if (!customElements.get(tagName)) {
|
|
351
|
+
customElements.define(tagName, PdsIcon);
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
} });
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export { PdsIcon as P, defineCustomElement as d };
|
|
358
|
+
|
|
359
|
+
//# sourceMappingURL=pds-icon2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"pds-icon2.js","mappings":";;AACA,IAAI,uBAAuB,GAAG,KAAK,CAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,MAAM,iBAAiB,GAAG,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,4BAA4B,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;AAC7J;AACA,IAAI,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACvD;AACA,IAAI,MAAM,YAAY,GAAG,6DAA6D,CAAC;AACvF,IAAI,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,IAAI,eAAe,IAAI,YAAY,IAAI,GAAG,CAAC;AAC5H;AACA,IAAI,IAAI,aAAa,CAAC,UAAU,CAAC,+BAA+B,CAAC,IAAI,CAAC,uBAAuB,EAAE;AAC/F,QAAQ,uBAAuB,GAAG,IAAI,CAAC;AACvC,QAAQ,OAAO,CAAC,IAAI,CAAC,CAAC;AACtB;AACA,IAAI,CAAC,CAAC,CAAC;AACP,KAAK;AACL,IAAI,IAAI,SAAS,GAAG,IAAI,CAAC;AACzB,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC/B,QAAQ,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACtC,KAA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AC;;;;;;;;;;;;;;;;;","names":[],"sources":["../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/assetPath.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/utils.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/validate.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/request.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/pds-icon.css?tag=pds-icon&encapsulation=shadow","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/pds-icon.js"],"sourcesContent":["import { Build } from \"@stencil/core\";\nlet missingAssetPathWarning = false;\n/**\n *\n * Reads the component asset path config from meta tag or a global variable.\n * This is a temporary workaround until these issues have been addressed:\n *\n * https://github.com/ionic-team/stencil/issues/2826/\n * https://github.com/ionic-team/stencil/issues/3470\n * https://github.com/ionic-team/stencil-ds-output-targets/issues/186\n */\nexport const getAssetPath = (path) => {\n var _a;\n const metaPineAssetPath = (_a = document.head.querySelector('meta[data-pine-asset-path]')) === null || _a === void 0 ? void 0 : _a.dataset.pineAssetPath;\n // Get the asset path from the window object if available\n const windowAssetPath = window.__PINE_ASSET_PATH__;\n // Set the CDN Asset path using the latest version\n const cdnAssetPath = 'https://cdn.jsdelivr.net/npm/@pine-ds/icons/dist/pds-icons/';\n const assetBasePath = Build.isTesting ? '/dist/pds-icons' : metaPineAssetPath || windowAssetPath || cdnAssetPath || '/';\n // Display a warning if the assets are fetched from the CDN.\n if (assetBasePath.startsWith('https://cdn.jsdelivr.net/npm/') && !missingAssetPathWarning) {\n missingAssetPathWarning = true;\n console.warn(`\n Fetching Pine asssets from jsDelivr CDN.\\n\\n It's recommended that you bundle Pine Assets with your application and setting the path accordingly.\\n\\nFor more information you read the documentation: \\nhttps://pine-design-system.netlify.app/?path=/docs/resources-assets--docs\n `);\n }\n let assetPath = path;\n if (path.startsWith('./')) {\n assetPath = path.substring(2);\n }\n if (!assetBasePath.endsWith('/')) {\n assetPath = '/' + assetPath;\n }\n return assetBasePath + assetPath;\n};\n//# sourceMappingURL=assetPath.js.map\n","import { getAssetPath } from \"./assetPath\";\nlet CACHED_MAP;\nexport const addIcons = (icons) => {\n const map = getIconMap();\n Object.keys(icons).forEach(name => map.set(name, icons[name]));\n};\nexport const getIconMap = () => {\n if (typeof window === 'undefined') {\n return new Map();\n }\n else {\n if (!CACHED_MAP) {\n const win = window; // eslint-disable-line @typescript-eslint/no-explicit-any\n win.PdsIcons = win.PdsIcons || {};\n CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();\n }\n return CACHED_MAP;\n }\n};\nexport const getName = (iconName, icon) => {\n if (!iconName && icon && !isSrc(icon)) {\n iconName = icon;\n }\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n const invalidChars = iconName.replace(/[a-z]|-|\\d/gi, '');\n if (invalidChars != '') {\n return null;\n }\n return iconName;\n};\nconst getNamedUrl = (iconName) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n return getAssetPath(`svg/${iconName}.svg`);\n};\nexport const getSrc = (src) => {\n if (isStr(src)) {\n src = src.trim();\n if (isSrc(src)) {\n return src;\n }\n }\n return null;\n};\nexport const getUrl = (pdsIcon) => {\n let url = getSrc(pdsIcon.src);\n if (url) {\n return url;\n }\n url = getName(pdsIcon.name, pdsIcon.icon);\n if (url) {\n return getNamedUrl(url);\n }\n if (pdsIcon.icon) {\n url = getSrc(pdsIcon.icon);\n if (url) {\n return url;\n }\n }\n return null;\n};\nexport const isSrc = (str) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const toLower = (val) => val.toLowerCase();\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `ion-input` should inherit\n * the `title` attribute that developers set directly on `ion-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (el, attributes = []) => {\n const attributeObject = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n return attributeObject;\n};\n//# sourceMappingURL=utils.js.map\n","import { isStr } from \"./utils\";\nexport const validateContent = (svgContent) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm)) {\n return div.innerHTML;\n }\n }\n return '';\n};\nexport const isValid = (elm) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i])) {\n return false;\n }\n }\n }\n return true;\n};\nexport const isSvgDataUrl = (url) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url) => url.indexOf(';utf8,') !== -1;\n//# sourceMappingURL=validate.js.map\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from \"./validate\";\nexport const pdsIconContent = new Map();\nconst requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any\nlet parser;\nexport const getSvgContent = (url, sanitize = false) => {\n let req = requests.get(url);\n if (!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n }\n return Promise.resolve();\n }\n else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n svgContent = validateContent(svgContent);\n }\n pdsIconContent.set(url, svgContent || '');\n });\n }\n pdsIconContent.set(url, '');\n });\n requests.set(url, req);\n }\n }\n else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n return req;\n};\n//# sourceMappingURL=request.js.map\n",":host {\n contain: strict;\n display: inline-block;\n fill: currentColor;\n height: 1em;\n width: 1em;\n}\n:host .pdsicon {\n fill: currentColor;\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}","import { Build, Host, h } from \"@stencil/core\";\nimport { getSvgContent, pdsIconContent } from \"./request\";\nimport { getName, getUrl, inheritAttributes } from \"./utils\";\nexport class PdsIcon {\n constructor() {\n this.inheritedAttributes = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n this.hasAriaHidden = () => {\n const { el } = this;\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n };\n this.ariaLabel = undefined;\n this.isVisible = false;\n this.svgContent = undefined;\n this.color = undefined;\n this.icon = undefined;\n this.name = undefined;\n this.size = 'regular';\n this.src = undefined;\n }\n iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n };\n if (sizes[this.size]) {\n return sizes[this.size];\n }\n else {\n return this.size;\n }\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n }\n connectedCallback() {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n loadIcon() {\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n }\n else {\n getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));\n }\n }\n }\n const label = getName(this.name, this.icon);\n if (label) {\n this.ariaLabel = label.replace(/\\-/g, ' ');\n }\n }\n render() {\n const { ariaLabel, inheritedAttributes } = this;\n const style = {\n height: this.iconSize(),\n width: this.iconSize(),\n color: this.color,\n };\n return (h(Host, Object.assign({ key: '450a12ddbe225916752aeb9323ff1a11d11bc4b3', \"aria-label\": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: \"img\", style: style, class: Object.assign({}, createColorClasses(this.color)) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h(\"div\", { class: \"icon-inner\", innerHTML: this.svgContent })) : (h(\"div\", { class: \"icon-inner\" }))));\n }\n /*****\n * Private Methods\n ****/\n waitUntilVisible(el, rootMargin, cb) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver((data) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n }, { rootMargin }));\n io.observe(el);\n }\n else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n static get is() { return \"pds-icon\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() {\n return {\n \"$\": [\"pds-icon.scss\"]\n };\n }\n static get styleUrls() {\n return {\n \"$\": [\"pds-icon.css\"]\n };\n }\n static get assetsDirs() { return [\"svg\"]; }\n static get properties() {\n return {\n \"color\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\\nThe color of the icon\"\n },\n \"attribute\": \"color\",\n \"reflect\": false\n },\n \"icon\": {\n \"type\": \"any\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"This a combination of both `name` and `src`. If a `src` url is detected\\nit will set the `src` property. Otherwise it assumes it's a built-in named\\nSVG and set the `name` property.\"\n },\n \"attribute\": \"icon\",\n \"reflect\": false\n },\n \"name\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The name of the icon to use from\\nthe built-in set.\"\n },\n \"attribute\": \"name\",\n \"reflect\": true\n },\n \"size\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"| 'small' // 12px\\n | 'regular' // 16px\\n | 'medium' // 20px\\n | 'large' // 24px\\n | 'auto'\\n | string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The size of the icon. This can be\\n'small', 'regular', 'medium', large, or a\\ncustom value (40px, 1rem, etc)\"\n },\n \"attribute\": \"size\",\n \"reflect\": true,\n \"defaultValue\": \"'regular'\"\n },\n \"src\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\\nSpecifies the exact `src` of an SVG file to use.\"\n },\n \"attribute\": \"src\",\n \"reflect\": false\n }\n };\n }\n static get states() {\n return {\n \"ariaLabel\": {},\n \"isVisible\": {},\n \"svgContent\": {}\n };\n }\n static get elementRef() { return \"el\"; }\n static get watchers() {\n return [{\n \"propName\": \"name\",\n \"methodName\": \"loadIcon\"\n }, {\n \"propName\": \"src\",\n \"methodName\": \"loadIcon\"\n }, {\n \"propName\": \"icon\",\n \"methodName\": \"loadIcon\"\n }];\n }\n}\nconst createColorClasses = (color) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n};\n//# sourceMappingURL=pds-icon.js.map\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PdsImage extends Components.PdsImage, HTMLElement {}
|
|
4
|
+
export const PdsImage: {
|
|
5
|
+
prototype: PdsImage;
|
|
6
|
+
new (): PdsImage;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const pdsImageCss = ":host{--dimension-aspect-ratio:auto;display:inline-block}img{aspect-ratio:var(--dimension-aspect-ratio);height:auto;width:100%}";
|
|
4
|
+
const PdsImageStyle0 = pdsImageCss;
|
|
5
|
+
|
|
6
|
+
const PdsImage$1 = /*@__PURE__*/ proxyCustomElement(class PdsImage extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.alt = '';
|
|
12
|
+
this.componentId = undefined;
|
|
13
|
+
this.height = undefined;
|
|
14
|
+
this.loading = 'eager';
|
|
15
|
+
this.sizes = undefined;
|
|
16
|
+
this.src = undefined;
|
|
17
|
+
this.srcset = undefined;
|
|
18
|
+
this.width = undefined;
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (h(Host, { key: '8d97b63e1c5b0eb72117d6378a0b6d869c0dbdea', class: {
|
|
22
|
+
'pds-image': true,
|
|
23
|
+
}, id: this.componentId }, h("img", { key: '3cc2d1c185244c8e8de2f7258b85194b37a4ff38', alt: this.alt, height: this.height, loading: this.loading, sizes: this.sizes, src: this.src, srcset: this.srcset, width: this.width })));
|
|
24
|
+
}
|
|
25
|
+
static get style() { return PdsImageStyle0; }
|
|
26
|
+
}, [1, "pds-image", {
|
|
27
|
+
"alt": [1],
|
|
28
|
+
"componentId": [1, "component-id"],
|
|
29
|
+
"height": [2],
|
|
30
|
+
"loading": [1],
|
|
31
|
+
"sizes": [1],
|
|
32
|
+
"src": [1],
|
|
33
|
+
"srcset": [1],
|
|
34
|
+
"width": [2]
|
|
35
|
+
}]);
|
|
36
|
+
function defineCustomElement$1() {
|
|
37
|
+
if (typeof customElements === "undefined") {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const components = ["pds-image"];
|
|
41
|
+
components.forEach(tagName => { switch (tagName) {
|
|
42
|
+
case "pds-image":
|
|
43
|
+
if (!customElements.get(tagName)) {
|
|
44
|
+
customElements.define(tagName, PdsImage$1);
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
} });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const PdsImage = PdsImage$1;
|
|
51
|
+
const defineCustomElement = defineCustomElement$1;
|
|
52
|
+
|
|
53
|
+
export { PdsImage, defineCustomElement };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=pds-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"pds-image.js","mappings":";;AAAA,MAAM,WAAW,GAAG,iIAAiI,CAAC;AACtJ,uBAAe,WAAW;;MCMbA,UAAQ;;;;;mBAKJ,EAAE;;;uBAiBoB,OAAO;;;;;;IA0B5C,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,WAAW,EAAE,IAAI;aAClB,EACD,EAAE,EAAE,IAAI,CAAC,WAAW,IAEpB,4DACE,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACG,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsImage"],"sources":["src/components/pds-image/pds-image.scss?tag=pds-image&encapsulation=shadow","src/components/pds-image/pds-image.tsx"],"sourcesContent":[":host {\n /**\n * @prop --image-aspect-ratio: The image's aspect ratio.\n */\n\n --dimension-aspect-ratio: auto;\n display: inline-block;\n}\n\nimg {\n aspect-ratio: var(--dimension-aspect-ratio);\n height: auto;\n width: 100%;\n}","import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pds-image',\n styleUrl: 'pds-image.scss',\n shadow: true,\n})\nexport class PdsImage {\n /**\n * The image's alt tag. If none is provided,\n * it will default to an empty string.\n */\n @Prop() alt? = '';\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * The height of the image in pixels. Setting this will\n * devote space in the layout to prevent layout\n * shifts when the image is loaded.\n */\n @Prop() height?: number;\n\n /**\n * Indicates how the browser should load the image.\n */\n @Prop() loading?: 'eager' | 'lazy' = 'eager';\n\n /**\n * Determines the intended display size of an image\n * within certian breakpoints. Has no effect if `srcset`\n * is not set or value has no width descriptor.\n */\n @Prop() sizes?: string;\n\n /**\n * The image's source.\n */\n @Prop() src: string;\n\n /**\n * A set of image sources for the browser to use.\n */\n @Prop() srcset?: string\n\n /**\n * The width of the image in pixels. Setting this will\n * devote space in the layout to prevent layout\n * shifts when the image is loaded.\n */\n @Prop() width?: number;\n\n render() {\n return (\n <Host\n class={{\n 'pds-image': true,\n }}\n id={this.componentId}\n >\n <img\n alt={this.alt}\n height={this.height}\n loading={this.loading}\n sizes={this.sizes}\n src={this.src}\n srcset={this.srcset}\n width={this.width}\n />\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PdsInput extends Components.PdsInput, HTMLElement {}
|
|
4
|
+
export const PdsInput: {
|
|
5
|
+
prototype: PdsInput;
|
|
6
|
+
new (): PdsInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { P as PdsLabel, a as assignDescription, m as messageId } from './pds-label.js';
|
|
3
|
+
|
|
4
|
+
const pdsInputCss = ":host{--box-shadow-focus:0 0 0 2px var(--pine-color-blue-200);--box-shadow-focus-error:0 0 0 2px var(--pine-color-red-200);--color-text-default:var(--pine-color-charcoal-500);--color-background-disabled:var(--pine-color-grey-100);--color-border-default:var(--pine-color-grey-400);--color-border-error:var(--pine-color-red-300);--color-border-hover:var(--pine-color-grey-500);--color-disabled-text:var(--pine-color-grey-500);--color-placeholder-text:var(--pine-color-charcoal-200);--font-size-helper-message:var(--pine-font-size-100);--font-size-input-field:var(--pine-font-size-100);--font-size-label:var(--pine-font-size-100);--font-weight-helper-message:var(--pine-font-weight-normal);--font-weight-input-field:var(--pine-font-weight-normal);--font-weight-label:var(--pine-font-weight-medium);--line-height-label:var(--pine-line-height-150);--line-height-helper-message:var(--pine-line-height-125);--line-height-input-field:var(--pine-line-height-150);--spacing-field-padding-block:var(--pine-spacing-100);--spacing-input-field-padding-inline:var(--pine-spacing-200);--spacing-label-margin-block-end:var(--pine-spacing-100);--spacing-margin-top-helper-message:var(--pine-spacing-100);display:inline}.pds-input{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}label{font-size:var(--font-size-label);font-weight:var(--font-weight-label);line-height:var(--line-height-label);-webkit-margin-after:var(--spacing-label-margin-block-end);margin-block-end:var(--spacing-label-margin-block-end)}input{border:1px solid var(--color-border-default);border-radius:10px;font-size:var(--font-size-input-field);font-weight:var(--font-weight-input-field);line-height:var(--line-height-input-field);padding:var(--spacing-field-padding-block) var(--spacing-input-field-padding-inline);}input:disabled{background-color:var(--color-background-disabled);color:var(--color-disabled-text);cursor:not-allowed}input:hover{border-color:var(--color-border-hover)}input:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}input::-webkit-input-placeholder{color:var(--color-placeholder-text)}input::-moz-placeholder{color:var(--color-placeholder-text)}input::-moz-placeholder{color:var(--color-placeholder-text)}input:-ms-input-placeholder{color:var(--color-placeholder-text)}input:has(~.pds-input__error-message){border-color:var(--color-border-error)}input:has(~.pds-input__error-message):focus-visible{-webkit-box-shadow:var(--box-shadow-focus-error);box-shadow:var(--box-shadow-focus-error);outline:none}.pds-input__error-message,.pds-input__helper-message{font-size:var(--font-size-helper-message);font-weight:var(--font-weight-helper-message);line-height:var(--line-height-helper-message);-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:var(--spacing-margin-top-helper-message);margin-block-start:var(--spacing-margin-top-helper-message)}.pds-input__error-message{color:var(--color-error)}";
|
|
5
|
+
const PdsInputStyle0 = pdsInputCss;
|
|
6
|
+
|
|
7
|
+
const PdsInput$1 = /*@__PURE__*/ proxyCustomElement(class PdsInput extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.pdsInput = createEvent(this, "pdsInput", 7);
|
|
13
|
+
this.onInputEvent = (ev) => {
|
|
14
|
+
const input = ev.target;
|
|
15
|
+
if (input) {
|
|
16
|
+
this.value = input.value || '';
|
|
17
|
+
}
|
|
18
|
+
this.pdsInput.emit(ev);
|
|
19
|
+
};
|
|
20
|
+
this.componentId = undefined;
|
|
21
|
+
this.disabled = undefined;
|
|
22
|
+
this.errorMessage = undefined;
|
|
23
|
+
this.helperMessage = undefined;
|
|
24
|
+
this.invalid = undefined;
|
|
25
|
+
this.label = undefined;
|
|
26
|
+
this.name = undefined;
|
|
27
|
+
this.placeholder = undefined;
|
|
28
|
+
this.readonly = undefined;
|
|
29
|
+
this.required = undefined;
|
|
30
|
+
this.type = 'text';
|
|
31
|
+
this.value = undefined;
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (h(Host, { key: 'd11ef85231a61d59752e289cb0832eb971115a84', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: '722e05d546051d094ee4d870eaaefea24d241032', class: "pds-input" }, h(PdsLabel, { key: 'a7ff96341748d12c1b9d56dfeb2fc5a9f1cfc2b7', htmlFor: this.componentId, text: this.label }), h("input", { key: '89d5b9cfa436ca98c58da38455c6e08abce6937c', class: "pds-input__field", "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, disabled: this.disabled, id: this.componentId, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInputEvent }), this.helperMessage &&
|
|
35
|
+
h("p", { key: '4fe86e4f98f16c25009b9011cf02e7a71c9050ef', class: "pds-input__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
36
|
+
h("p", { key: '50c1d4b6603868f5494c599298b23814df26782b', class: "pds-input__error-message", id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, this.errorMessage))));
|
|
37
|
+
}
|
|
38
|
+
static get style() { return PdsInputStyle0; }
|
|
39
|
+
}, [1, "pds-input", {
|
|
40
|
+
"componentId": [1, "component-id"],
|
|
41
|
+
"disabled": [4],
|
|
42
|
+
"errorMessage": [1, "error-message"],
|
|
43
|
+
"helperMessage": [1, "helper-message"],
|
|
44
|
+
"invalid": [4],
|
|
45
|
+
"label": [1],
|
|
46
|
+
"name": [1],
|
|
47
|
+
"placeholder": [1],
|
|
48
|
+
"readonly": [4],
|
|
49
|
+
"required": [4],
|
|
50
|
+
"type": [1],
|
|
51
|
+
"value": [1025]
|
|
52
|
+
}]);
|
|
53
|
+
function defineCustomElement$1() {
|
|
54
|
+
if (typeof customElements === "undefined") {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const components = ["pds-input"];
|
|
58
|
+
components.forEach(tagName => { switch (tagName) {
|
|
59
|
+
case "pds-input":
|
|
60
|
+
if (!customElements.get(tagName)) {
|
|
61
|
+
customElements.define(tagName, PdsInput$1);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
} });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const PdsInput = PdsInput$1;
|
|
68
|
+
const defineCustomElement = defineCustomElement$1;
|
|
69
|
+
|
|
70
|
+
export { PdsInput, defineCustomElement };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=pds-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"pds-input.js","mappings":";;;AAAA,MAAM,WAAW,GAAG,05FAA05F,CAAC;AAC/6F,uBAAe,WAAW;;MCQbA,UAAQ;;;;;;QAoEX,iBAAY,GAAG,CAAC,EAAS;YAC/B,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,KAAK,EAAE;gBACT,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;aAChC;YACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAgB,CAAC,CAAC;SACtC,CAAC;;;;;;;;;;;oBAlBa,MAAM;;;IAoBrB,MAAM;QACJ,QACE,EAAC,IAAI,sEACY,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,IAE5C,4DAAK,KAAK,EAAC,WAAW,IACpB,EAAC,QAAQ,qDAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,GAAI,EACzD,8DAAO,KAAK,EAAC,kBAAkB,sBACX,iBAAiB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,kBACzE,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,SAAS,EAC/C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,YAAY,GAC1B,EACD,IAAI,CAAC,aAAa;YACjB,0DACE,KAAK,EAAC,2BAA2B,EACjC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,IAExC,IAAI,CAAC,aAAa,CACjB,EAEL,IAAI,CAAC,YAAY;YAChB,0DACE,KAAK,EAAC,0BAA0B,EAChC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,eAC9B,WAAW,IAEpB,IAAI,CAAC,YAAY,CAChB,CAEF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsInput"],"sources":["src/components/pds-input/pds-input.scss?tag=pds-input&encapsulation=shadow","src/components/pds-input/pds-input.tsx"],"sourcesContent":[":host {\n --box-shadow-focus: 0 0 0 2px var(--pine-color-blue-200);\n --box-shadow-focus-error: 0 0 0 2px var(--pine-color-red-200);\n\n --color-text-default: var(--pine-color-charcoal-500);\n --color-background-disabled: var(--pine-color-grey-100);\n --color-border-default: var(--pine-color-grey-400);\n --color-border-error: var(--pine-color-red-300);\n --color-border-hover: var(--pine-color-grey-500);\n --color-disabled-text: var(--pine-color-grey-500);\n --color-placeholder-text: var(--pine-color-charcoal-200);\n\n --font-size-helper-message: var(--pine-font-size-100);\n --font-size-input-field: var(--pine-font-size-100);\n --font-size-label: var(--pine-font-size-100);\n --font-weight-helper-message: var(--pine-font-weight-normal);\n --font-weight-input-field: var(--pine-font-weight-normal);\n --font-weight-label: var(--pine-font-weight-medium);\n\n --line-height-label: var(--pine-line-height-150);\n --line-height-helper-message: var(--pine-line-height-125);\n --line-height-input-field: var(--pine-line-height-150);\n\n --spacing-field-padding-block: var(--pine-spacing-100);\n --spacing-input-field-padding-inline: var(--pine-spacing-200);\n --spacing-label-margin-block-end: var(--pine-spacing-100);\n --spacing-margin-top-helper-message: var(--pine-spacing-100);\n\n display: inline;\n}\n\n.pds-input {\n display: flex;\n flex-direction: column;\n}\n\nlabel {\n font-size: var(--font-size-label);\n font-weight: var(--font-weight-label);\n line-height: var(--line-height-label);\n margin-block-end: var(--spacing-label-margin-block-end);\n}\n\ninput {\n border: 1px solid var(--color-border-default);\n border-radius: 10px;\n font-size: var(--font-size-input-field);\n font-weight: var(--font-weight-input-field);\n line-height: var(--line-height-input-field);\n padding: var(--spacing-field-padding-block) var(--spacing-input-field-padding-inline);\n\n &:disabled {\n background-color: var(--color-background-disabled);\n color: var(--color-disabled-text);\n cursor: not-allowed;\n }\n\n &:hover {\n border-color: var(--color-border-hover);\n }\n\n &:focus-visible {\n box-shadow: var(--box-shadow-focus);\n outline: none;\n }\n\n /* stylelint-disable */\n &::-webkit-input-placeholder {\n color: var(--color-placeholder-text);\n }\n\n &::-moz-placeholder {\n color: var(--color-placeholder-text);\n }\n\n &::-moz-placeholder {\n color: var(--color-placeholder-text);\n }\n\n &:-ms-input-placeholder {\n color: var(--color-placeholder-text);\n }\n\n &:has(~.pds-input__error-message) {\n border-color: var(--color-border-error);\n\n &:focus-visible {\n box-shadow: var(--box-shadow-focus-error);\n outline: none;\n }\n }\n /* stylelint-enable */\n}\n\n.pds-input__error-message,\n.pds-input__helper-message {\n font-size: var(--font-size-helper-message);\n font-weight: var(--font-weight-helper-message);\n line-height: var(--line-height-helper-message);\n margin-block-end: 0;\n margin-block-start: var(--spacing-margin-top-helper-message);\n}\n\n.pds-input__error-message {\n color: var(--color-error);\n}\n","import { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { PdsLabel } from '../_internal/pds-label/pds-label';\n\n@Component({\n tag: 'pds-input',\n styleUrl: 'pds-input.scss',\n shadow: true,\n})\nexport class PdsInput {\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Indicates whether or not the input field is disabled.\n */\n @Prop() disabled?: boolean;\n\n /**\n * Specifies the error message and provides an error-themed treatment to the field.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Displays a message or hint below the input field.\n */\n @Prop() helperMessage?: string;\n\n /**\n * Indicates whether or not the input field is invalid or throws an error.\n */\n @Prop() invalid?: boolean;\n\n /**\n * Text to be displayed as the input label.\n */\n @Prop() label?: string;\n\n /**\n * Specifies the name. Submitted with the form name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * Specifies a short hint that describes the expected value of the input field.\n */\n @Prop() placeholder?: string;\n\n /**\n * Indicates whether or not the input field is readonly.\n */\n @Prop() readonly?: boolean;\n\n /**\n * Indicates whether or not the input field is required.\n */\n @Prop() required?: boolean;\n\n /**\n * Determines the type of control that will be displayed\n `'email'`, `'number'`, `'password'`, `'tel'`, `'text'`\n * @defaultValue \"text\"\n */\n @Prop() type = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string;\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() pdsInput: EventEmitter<InputEvent>;\n\n private onInputEvent = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.pdsInput.emit(ev as InputEvent);\n };\n\n render() {\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n >\n <div class=\"pds-input\">\n <PdsLabel htmlFor={this.componentId} text={this.label} />\n <input class=\"pds-input__field\"\n aria-describedby={assignDescription(this.componentId, this.invalid, this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n disabled={this.disabled}\n id={this.componentId}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n type={this.type}\n value={this.value}\n onInput={this.onInputEvent}\n />\n {this.helperMessage &&\n <p\n class=\"pds-input__helper-message\"\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </p>\n }\n {this.errorMessage &&\n <p\n class=\"pds-input__error-message\"\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n {this.errorMessage}\n </p>\n }\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create id for messaging
|
|
5
|
+
*/
|
|
6
|
+
const messageId = (id, messageType) => {
|
|
7
|
+
return `${id}__${messageType}-message`;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Assign aria-description id to relate messages with form element
|
|
11
|
+
*/
|
|
12
|
+
const assignDescription = (id, invalid, helperMessage) => {
|
|
13
|
+
if (!helperMessage)
|
|
14
|
+
return;
|
|
15
|
+
let relatedId = messageId(id, 'helper');
|
|
16
|
+
if (invalid)
|
|
17
|
+
relatedId = messageId(id, 'error');
|
|
18
|
+
return relatedId;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Updates the `invalid` prop of a form element based on it's values validity
|
|
22
|
+
*/
|
|
23
|
+
const isRequired = (target, component) => {
|
|
24
|
+
if (!target || !component)
|
|
25
|
+
return;
|
|
26
|
+
if (component.required === true) {
|
|
27
|
+
(target.checkValidity() === false) ? component.invalid = true : component.invalid = false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Returns markup for an input label.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
const PdsLabel = ({ classNames, htmlFor, text }) => (h("label", { class: classNames, htmlFor: htmlFor }, text));
|
|
36
|
+
|
|
37
|
+
export { PdsLabel as P, assignDescription as a, isRequired as i, messageId as m };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=pds-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"pds-label.js","mappings":";;AAAA;;;MAGa,SAAS,GAAG,CAAC,EAAU,EAAE,WAAmB;IACvD,OAAO,GAAG,EAAE,KAAK,WAAW,UAAU,CAAC;AACzC,EAAE;AAEF;;;MAGa,iBAAiB,GAAG,CAAC,EAAU,EAAE,OAAgB,EAAE,aAAqB;IACnF,IAAI,CAAC,aAAa;QAAE,OAAM;IAE1B,IAAI,SAAS,GAAG,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IAEvC,IAAI,OAAO;QAAE,SAAS,GAAG,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAEhD,OAAO,SAAS,CAAC;AACnB,EAAE;AAEF;;;MAGa,UAAU,GAAG,CAAC,MAAM,EAAE,SAAS;IAC1C,IAAK,CAAC,MAAM,IAAI,CAAC,SAAS;QAAG,OAAO;IACpC,IAAI,SAAS,CAAC,QAAQ,KAAK,IAAI,EAAE;QAC/B,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,KAAK,IAAI,SAAS,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;KAC3F;AACH;;ACVA;;;;MAIa,QAAQ,GAAoC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MACrF,aAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,IAAG,IAAI,CAAS;;;;","names":[],"sources":["src/utils/form.ts","src/components/_internal/pds-label/pds-label.tsx"],"sourcesContent":["/**\n * Create id for messaging\n */\nexport const messageId = (id: string, messageType: string) => {\n return `${id}__${messageType}-message`;\n};\n\n/**\n * Assign aria-description id to relate messages with form element\n */\nexport const assignDescription = (id: string, invalid: boolean, helperMessage: string) => {\n if (!helperMessage) return\n\n let relatedId = messageId(id, 'helper')\n\n if (invalid) relatedId = messageId(id, 'error');\n\n return relatedId;\n};\n\n/**\n * Updates the `invalid` prop of a form element based on it's values validity\n */\nexport const isRequired = (target, component) => {\n if ( !target || !component ) return;\n if (component.required === true) {\n (target.checkValidity() === false) ? component.invalid = true : component.invalid = false;\n }\n}\n","import { FunctionalComponent, h } from '@stencil/core';\n\n/**\n * Props for the input label.\n */\ninterface LabelProps {\n classNames?: string,\n /**\n * Corresponds to the 'for' attribute on a label. Useful for\n * associating a label with a specific input.\n */\n htmlFor: string,\n /**\n * Label text displayed.\n */\n text: string,\n}\n\n/**\n * Returns markup for an input label.\n * @internal\n */\nexport const PdsLabel: FunctionalComponent<LabelProps> = ({ classNames, htmlFor, text }) => (\n <label class={classNames} htmlFor={htmlFor}>{text}</label>\n);\n"],"version":3}
|