smoothly 0.1.114 → 0.1.115
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/dist/cjs/{Notice-9c2b52b7.js → Notice-839702d8.js} +34 -26
- package/dist/cjs/{Trigger-74bd1ee8.js → Trigger-cf376531.js} +55 -146
- package/dist/cjs/{index-41a36ce2.js → index-1c61bdd3.js} +27 -1
- package/dist/cjs/index.cjs.js +20 -8
- package/dist/cjs/loader.cjs.js +3 -19
- package/dist/cjs/{smoothly-accordion_50.cjs.entry.js → smoothly-accordion_51.cjs.entry.js} +7689 -1483
- package/dist/cjs/smoothly-google-font.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-reorder.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +5 -5
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +5 -5
- package/dist/cjs/smoothly.cjs.js +5 -113
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/app-demo/index.js +6 -1
- package/dist/collection/components/button/index.js +168 -0
- package/dist/collection/components/button/style.css +49 -0
- package/dist/collection/components/picker/index.js +10 -6
- package/dist/collection/components/trigger/style.css +3 -3
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +7776 -2966
- package/dist/esm/{Notice-4131b4e0.js → Notice-608b552c.js} +34 -26
- package/dist/esm/{Trigger-d7b181ec.js → Trigger-365408f0.js} +55 -146
- package/dist/esm/{index-dcb2b612.js → index-a3737440.js} +27 -1
- package/dist/esm/index.js +17 -4
- package/dist/esm/loader.js +3 -19
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{smoothly-accordion_50.entry.js → smoothly-accordion_51.entry.js} +7689 -1484
- package/dist/esm/smoothly-google-font.entry.js +2 -2
- package/dist/esm/smoothly-radio-group.entry.js +2 -2
- package/dist/esm/smoothly-reorder.entry.js +2 -2
- package/dist/esm/smoothly-trigger-sink.entry.js +3 -3
- package/dist/esm/smoothly-trigger-source.entry.js +3 -3
- package/dist/esm/smoothly.js +5 -113
- package/dist/smoothly/index.esm.js +1 -376
- package/dist/smoothly/p-0215b4da.entry.js +1 -0
- package/dist/smoothly/{p-074a0448.js → p-0cba3e3d.js} +1 -1
- package/dist/smoothly/p-18a1063c.entry.js +1 -0
- package/dist/smoothly/p-6ca0d36c.js +1 -0
- package/dist/smoothly/p-6f009ac9.entry.js +1 -0
- package/dist/smoothly/p-7a30d9b8.js +1 -0
- package/dist/smoothly/p-8ae38136.entry.js +1 -0
- package/dist/smoothly/p-993534fa.entry.js +1 -0
- package/dist/smoothly/p-eec1c703.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -125
- package/dist/types/components/button/index.d.ts +11 -0
- package/dist/types/components.d.ts +27 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/package.json +17 -17
- package/dist/cjs/App-339acc9b.js +0 -647
- package/dist/cjs/_commonjsHelpers-10109b76.js +0 -48
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-88cc6900.js +0 -6
- package/dist/cjs/dom-95afd968.js +0 -75
- package/dist/cjs/generate-f9a36f25.js +0 -66
- package/dist/cjs/index-138c41c2.js +0 -3066
- package/dist/cjs/index-36da3c23.js +0 -1673
- package/dist/cjs/index-40d009d5.js +0 -1354
- package/dist/cjs/index-ac32385c.js +0 -18850
- package/dist/cjs/shadow-css-71d0f821.js +0 -391
- package/dist/cjs/smoothly-accordion-item.cjs.entry.js +0 -54
- package/dist/cjs/smoothly-accordion.cjs.entry.js +0 -55
- package/dist/cjs/smoothly-app-demo.cjs.entry.js +0 -29
- package/dist/cjs/smoothly-app.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-backtotop.cjs.entry.js +0 -37
- package/dist/cjs/smoothly-calendar.cjs.entry.js +0 -95
- package/dist/cjs/smoothly-checkbox.cjs.entry.js +0 -18671
- package/dist/cjs/smoothly-dialog-demo.cjs.entry.js +0 -16
- package/dist/cjs/smoothly-dialog.cjs.entry.js +0 -38
- package/dist/cjs/smoothly-display-amount.cjs.entry.js +0 -59
- package/dist/cjs/smoothly-display-date-time.cjs.entry.js +0 -20
- package/dist/cjs/smoothly-display-demo.cjs.entry.js +0 -25
- package/dist/cjs/smoothly-display.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-frame.cjs.entry.js +0 -50
- package/dist/cjs/smoothly-icon-demo.cjs.entry.js +0 -491
- package/dist/cjs/smoothly-icon.cjs.entry.js +0 -52
- package/dist/cjs/smoothly-input-date-range.cjs.entry.js +0 -50
- package/dist/cjs/smoothly-input-date.cjs.entry.js +0 -44
- package/dist/cjs/smoothly-input-demo.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-input-month.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-input.cjs.entry.js +0 -202
- package/dist/cjs/smoothly-item.cjs.entry.js +0 -43
- package/dist/cjs/smoothly-menu-options.cjs.entry.js +0 -108
- package/dist/cjs/smoothly-notification.cjs.entry.js +0 -67
- package/dist/cjs/smoothly-notifier.cjs.entry.js +0 -29
- package/dist/cjs/smoothly-option.cjs.entry.js +0 -33
- package/dist/cjs/smoothly-picker.cjs.entry.js +0 -151
- package/dist/cjs/smoothly-popup.cjs.entry.js +0 -38
- package/dist/cjs/smoothly-quiet.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-radio.cjs.entry.js +0 -28
- package/dist/cjs/smoothly-room.cjs.entry.js +0 -16
- package/dist/cjs/smoothly-select-demo.cjs.entry.js +0 -86
- package/dist/cjs/smoothly-select.cjs.entry.js +0 -31
- package/dist/cjs/smoothly-selector.cjs.entry.js +0 -119
- package/dist/cjs/smoothly-skeleton.cjs.entry.js +0 -27
- package/dist/cjs/smoothly-spinner.cjs.entry.js +0 -24
- package/dist/cjs/smoothly-submit.cjs.entry.js +0 -60
- package/dist/cjs/smoothly-svg.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-tab-switch.cjs.entry.js +0 -32
- package/dist/cjs/smoothly-tab.cjs.entry.js +0 -37
- package/dist/cjs/smoothly-table-cell.cjs.entry.js +0 -19
- package/dist/cjs/smoothly-table-demo.cjs.entry.js +0 -22
- package/dist/cjs/smoothly-table-expandable-cell.cjs.entry.js +0 -45
- package/dist/cjs/smoothly-table-expandable-row.cjs.entry.js +0 -32
- package/dist/cjs/smoothly-table-header.cjs.entry.js +0 -41
- package/dist/cjs/smoothly-table-row.cjs.entry.js +0 -38
- package/dist/cjs/smoothly-table.cjs.entry.js +0 -26
- package/dist/cjs/smoothly-trigger.cjs.entry.js +0 -36
- package/dist/cjs/smoothly-tuple.cjs.entry.js +0 -16
- package/dist/cjs/smoothly-urlencoded.cjs.entry.js +0 -19
- package/dist/esm/App-22187759.js +0 -645
- package/dist/esm/_commonjsHelpers-8fe71198.js +0 -44
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-c64026cd.js +0 -4
- package/dist/esm/dom-a712b575.js +0 -73
- package/dist/esm/generate-50b98474.js +0 -61
- package/dist/esm/index-02a70ac1.js +0 -3027
- package/dist/esm/index-a5a08f46.js +0 -18848
- package/dist/esm/index-c8b5d468.js +0 -1349
- package/dist/esm/index-d1360bcf.js +0 -1671
- package/dist/esm/shadow-css-1e16431b.js +0 -389
- package/dist/esm/smoothly-accordion-item.entry.js +0 -50
- package/dist/esm/smoothly-accordion.entry.js +0 -51
- package/dist/esm/smoothly-app-demo.entry.js +0 -25
- package/dist/esm/smoothly-app.entry.js +0 -15
- package/dist/esm/smoothly-backtotop.entry.js +0 -33
- package/dist/esm/smoothly-calendar.entry.js +0 -91
- package/dist/esm/smoothly-checkbox.entry.js +0 -18667
- package/dist/esm/smoothly-dialog-demo.entry.js +0 -12
- package/dist/esm/smoothly-dialog.entry.js +0 -34
- package/dist/esm/smoothly-display-amount.entry.js +0 -55
- package/dist/esm/smoothly-display-date-time.entry.js +0 -16
- package/dist/esm/smoothly-display-demo.entry.js +0 -21
- package/dist/esm/smoothly-display.entry.js +0 -37
- package/dist/esm/smoothly-frame.entry.js +0 -46
- package/dist/esm/smoothly-icon-demo.entry.js +0 -487
- package/dist/esm/smoothly-icon.entry.js +0 -48
- package/dist/esm/smoothly-input-date-range.entry.js +0 -46
- package/dist/esm/smoothly-input-date.entry.js +0 -40
- package/dist/esm/smoothly-input-demo.entry.js +0 -15
- package/dist/esm/smoothly-input-month.entry.js +0 -37
- package/dist/esm/smoothly-input.entry.js +0 -198
- package/dist/esm/smoothly-item.entry.js +0 -39
- package/dist/esm/smoothly-menu-options.entry.js +0 -104
- package/dist/esm/smoothly-notification.entry.js +0 -63
- package/dist/esm/smoothly-notifier.entry.js +0 -25
- package/dist/esm/smoothly-option.entry.js +0 -29
- package/dist/esm/smoothly-picker.entry.js +0 -147
- package/dist/esm/smoothly-popup.entry.js +0 -34
- package/dist/esm/smoothly-quiet.entry.js +0 -15
- package/dist/esm/smoothly-radio.entry.js +0 -24
- package/dist/esm/smoothly-room.entry.js +0 -12
- package/dist/esm/smoothly-select-demo.entry.js +0 -82
- package/dist/esm/smoothly-select.entry.js +0 -27
- package/dist/esm/smoothly-selector.entry.js +0 -115
- package/dist/esm/smoothly-skeleton.entry.js +0 -23
- package/dist/esm/smoothly-spinner.entry.js +0 -20
- package/dist/esm/smoothly-submit.entry.js +0 -56
- package/dist/esm/smoothly-svg.entry.js +0 -37
- package/dist/esm/smoothly-tab-switch.entry.js +0 -28
- package/dist/esm/smoothly-tab.entry.js +0 -33
- package/dist/esm/smoothly-table-cell.entry.js +0 -15
- package/dist/esm/smoothly-table-demo.entry.js +0 -18
- package/dist/esm/smoothly-table-expandable-cell.entry.js +0 -41
- package/dist/esm/smoothly-table-expandable-row.entry.js +0 -28
- package/dist/esm/smoothly-table-header.entry.js +0 -37
- package/dist/esm/smoothly-table-row.entry.js +0 -34
- package/dist/esm/smoothly-table.entry.js +0 -22
- package/dist/esm/smoothly-trigger.entry.js +0 -32
- package/dist/esm/smoothly-tuple.entry.js +0 -12
- package/dist/esm/smoothly-urlencoded.entry.js +0 -15
- package/dist/smoothly/App-22187759.js +0 -645
- package/dist/smoothly/GoogleFont-8474516b.js +0 -21
- package/dist/smoothly/_commonjsHelpers-8fe71198.js +0 -44
- package/dist/smoothly/app-globals-0f993ce5.js +0 -3
- package/dist/smoothly/css-shim-c64026cd.js +0 -4
- package/dist/smoothly/dom-a712b575.js +0 -73
- package/dist/smoothly/generate-50b98474.js +0 -61
- package/dist/smoothly/index-02a70ac1.js +0 -3027
- package/dist/smoothly/index-a5a08f46.js +0 -18848
- package/dist/smoothly/index-c8b5d468.js +0 -1349
- package/dist/smoothly/index-d1360bcf.js +0 -1671
- package/dist/smoothly/p-0bad2c46.entry.js +0 -1
- package/dist/smoothly/p-0c1e9588.entry.js +0 -1
- package/dist/smoothly/p-14232157.entry.js +0 -1
- package/dist/smoothly/p-19518931.js +0 -1
- package/dist/smoothly/p-22d4d5a7.entry.js +0 -1
- package/dist/smoothly/p-2cda1784.js +0 -1
- package/dist/smoothly/p-9fa3ab06.entry.js +0 -1
- package/dist/smoothly/p-b8a3e273.entry.js +0 -1
- package/dist/smoothly/shadow-css-1e16431b.js +0 -389
- package/dist/smoothly/smoothly-accordion-item.entry.js +0 -50
- package/dist/smoothly/smoothly-accordion.entry.js +0 -51
- package/dist/smoothly/smoothly-app-demo.entry.js +0 -25
- package/dist/smoothly/smoothly-app.entry.js +0 -15
- package/dist/smoothly/smoothly-backtotop.entry.js +0 -33
- package/dist/smoothly/smoothly-calendar.entry.js +0 -91
- package/dist/smoothly/smoothly-checkbox.entry.js +0 -18667
- package/dist/smoothly/smoothly-dialog-demo.entry.js +0 -12
- package/dist/smoothly/smoothly-dialog.entry.js +0 -34
- package/dist/smoothly/smoothly-display-amount.entry.js +0 -55
- package/dist/smoothly/smoothly-display-date-time.entry.js +0 -16
- package/dist/smoothly/smoothly-display-demo.entry.js +0 -21
- package/dist/smoothly/smoothly-display.entry.js +0 -37
- package/dist/smoothly/smoothly-frame.entry.js +0 -46
- package/dist/smoothly/smoothly-google-font.entry.js +0 -13
- package/dist/smoothly/smoothly-icon-demo.entry.js +0 -487
- package/dist/smoothly/smoothly-icon.entry.js +0 -48
- package/dist/smoothly/smoothly-input-date-range.entry.js +0 -46
- package/dist/smoothly/smoothly-input-date.entry.js +0 -40
- package/dist/smoothly/smoothly-input-demo.entry.js +0 -15
- package/dist/smoothly/smoothly-input-month.entry.js +0 -37
- package/dist/smoothly/smoothly-input.entry.js +0 -198
- package/dist/smoothly/smoothly-item.entry.js +0 -39
- package/dist/smoothly/smoothly-menu-options.entry.js +0 -104
- package/dist/smoothly/smoothly-notification.entry.js +0 -63
- package/dist/smoothly/smoothly-notifier.entry.js +0 -25
- package/dist/smoothly/smoothly-option.entry.js +0 -29
- package/dist/smoothly/smoothly-picker.entry.js +0 -147
- package/dist/smoothly/smoothly-popup.entry.js +0 -34
- package/dist/smoothly/smoothly-quiet.entry.js +0 -15
- package/dist/smoothly/smoothly-radio-group.entry.js +0 -16
- package/dist/smoothly/smoothly-radio.entry.js +0 -24
- package/dist/smoothly/smoothly-reorder.entry.js +0 -99
- package/dist/smoothly/smoothly-room.entry.js +0 -12
- package/dist/smoothly/smoothly-select-demo.entry.js +0 -82
- package/dist/smoothly/smoothly-select.entry.js +0 -27
- package/dist/smoothly/smoothly-selector.entry.js +0 -115
- package/dist/smoothly/smoothly-skeleton.entry.js +0 -23
- package/dist/smoothly/smoothly-spinner.entry.js +0 -20
- package/dist/smoothly/smoothly-submit.entry.js +0 -56
- package/dist/smoothly/smoothly-svg.entry.js +0 -37
- package/dist/smoothly/smoothly-tab-switch.entry.js +0 -28
- package/dist/smoothly/smoothly-tab.entry.js +0 -33
- package/dist/smoothly/smoothly-table-cell.entry.js +0 -15
- package/dist/smoothly/smoothly-table-demo.entry.js +0 -18
- package/dist/smoothly/smoothly-table-expandable-cell.entry.js +0 -41
- package/dist/smoothly/smoothly-table-expandable-row.entry.js +0 -28
- package/dist/smoothly/smoothly-table-header.entry.js +0 -37
- package/dist/smoothly/smoothly-table-row.entry.js +0 -34
- package/dist/smoothly/smoothly-table.entry.js +0 -22
- package/dist/smoothly/smoothly-trigger-sink.entry.js +0 -29
- package/dist/smoothly/smoothly-trigger-source.entry.js +0 -28
- package/dist/smoothly/smoothly-trigger.entry.js +0 -32
- package/dist/smoothly/smoothly-tuple.entry.js +0 -12
- package/dist/smoothly/smoothly-urlencoded.entry.js +0 -15
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Stencil Client Platform v2.10.0 | MIT Licensed | https://stenciljs.com
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* @license
|
|
6
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
9
|
-
* found in the LICENSE file at https://angular.io/license
|
|
10
|
-
*
|
|
11
|
-
* This file is a port of shadowCSS from webcomponents.js to TypeScript.
|
|
12
|
-
* https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
|
|
13
|
-
* https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
|
|
14
|
-
*/
|
|
15
|
-
const safeSelector = (selector) => {
|
|
16
|
-
const placeholders = [];
|
|
17
|
-
let index = 0;
|
|
18
|
-
let content;
|
|
19
|
-
// Replaces attribute selectors with placeholders.
|
|
20
|
-
// The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
|
|
21
|
-
selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
|
|
22
|
-
const replaceBy = `__ph-${index}__`;
|
|
23
|
-
placeholders.push(keep);
|
|
24
|
-
index++;
|
|
25
|
-
return replaceBy;
|
|
26
|
-
});
|
|
27
|
-
// Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
|
|
28
|
-
// WS and "+" would otherwise be interpreted as selector separators.
|
|
29
|
-
content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
|
|
30
|
-
const replaceBy = `__ph-${index}__`;
|
|
31
|
-
placeholders.push(exp);
|
|
32
|
-
index++;
|
|
33
|
-
return pseudo + replaceBy;
|
|
34
|
-
});
|
|
35
|
-
const ss = {
|
|
36
|
-
content,
|
|
37
|
-
placeholders,
|
|
38
|
-
};
|
|
39
|
-
return ss;
|
|
40
|
-
};
|
|
41
|
-
const restoreSafeSelector = (placeholders, content) => {
|
|
42
|
-
return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
|
|
43
|
-
};
|
|
44
|
-
const _polyfillHost = '-shadowcsshost';
|
|
45
|
-
const _polyfillSlotted = '-shadowcssslotted';
|
|
46
|
-
// note: :host-context pre-processed to -shadowcsshostcontext.
|
|
47
|
-
const _polyfillHostContext = '-shadowcsscontext';
|
|
48
|
-
const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
|
|
49
|
-
const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
|
|
50
|
-
const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
|
|
51
|
-
const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
|
|
52
|
-
const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
|
|
53
|
-
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
54
|
-
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
55
|
-
const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
|
|
56
|
-
const _polyfillHostRe = /-shadowcsshost/gim;
|
|
57
|
-
const _colonHostRe = /:host/gim;
|
|
58
|
-
const _colonSlottedRe = /::slotted/gim;
|
|
59
|
-
const _colonHostContextRe = /:host-context/gim;
|
|
60
|
-
const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
|
|
61
|
-
const stripComments = (input) => {
|
|
62
|
-
return input.replace(_commentRe, '');
|
|
63
|
-
};
|
|
64
|
-
const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
|
|
65
|
-
const extractCommentsWithHash = (input) => {
|
|
66
|
-
return input.match(_commentWithHashRe) || [];
|
|
67
|
-
};
|
|
68
|
-
const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
|
69
|
-
const _curlyRe = /([{}])/g;
|
|
70
|
-
const OPEN_CURLY = '{';
|
|
71
|
-
const CLOSE_CURLY = '}';
|
|
72
|
-
const BLOCK_PLACEHOLDER = '%BLOCK%';
|
|
73
|
-
const processRules = (input, ruleCallback) => {
|
|
74
|
-
const inputWithEscapedBlocks = escapeBlocks(input);
|
|
75
|
-
let nextBlockIndex = 0;
|
|
76
|
-
return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
|
|
77
|
-
const selector = m[2];
|
|
78
|
-
let content = '';
|
|
79
|
-
let suffix = m[4];
|
|
80
|
-
let contentPrefix = '';
|
|
81
|
-
if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
|
|
82
|
-
content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
|
|
83
|
-
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
|
|
84
|
-
contentPrefix = '{';
|
|
85
|
-
}
|
|
86
|
-
const cssRule = {
|
|
87
|
-
selector,
|
|
88
|
-
content,
|
|
89
|
-
};
|
|
90
|
-
const rule = ruleCallback(cssRule);
|
|
91
|
-
return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
const escapeBlocks = (input) => {
|
|
95
|
-
const inputParts = input.split(_curlyRe);
|
|
96
|
-
const resultParts = [];
|
|
97
|
-
const escapedBlocks = [];
|
|
98
|
-
let bracketCount = 0;
|
|
99
|
-
let currentBlockParts = [];
|
|
100
|
-
for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
|
|
101
|
-
const part = inputParts[partIndex];
|
|
102
|
-
if (part === CLOSE_CURLY) {
|
|
103
|
-
bracketCount--;
|
|
104
|
-
}
|
|
105
|
-
if (bracketCount > 0) {
|
|
106
|
-
currentBlockParts.push(part);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
if (currentBlockParts.length > 0) {
|
|
110
|
-
escapedBlocks.push(currentBlockParts.join(''));
|
|
111
|
-
resultParts.push(BLOCK_PLACEHOLDER);
|
|
112
|
-
currentBlockParts = [];
|
|
113
|
-
}
|
|
114
|
-
resultParts.push(part);
|
|
115
|
-
}
|
|
116
|
-
if (part === OPEN_CURLY) {
|
|
117
|
-
bracketCount++;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (currentBlockParts.length > 0) {
|
|
121
|
-
escapedBlocks.push(currentBlockParts.join(''));
|
|
122
|
-
resultParts.push(BLOCK_PLACEHOLDER);
|
|
123
|
-
}
|
|
124
|
-
const strEscapedBlocks = {
|
|
125
|
-
escapedString: resultParts.join(''),
|
|
126
|
-
blocks: escapedBlocks,
|
|
127
|
-
};
|
|
128
|
-
return strEscapedBlocks;
|
|
129
|
-
};
|
|
130
|
-
const insertPolyfillHostInCssText = (selector) => {
|
|
131
|
-
selector = selector
|
|
132
|
-
.replace(_colonHostContextRe, _polyfillHostContext)
|
|
133
|
-
.replace(_colonHostRe, _polyfillHost)
|
|
134
|
-
.replace(_colonSlottedRe, _polyfillSlotted);
|
|
135
|
-
return selector;
|
|
136
|
-
};
|
|
137
|
-
const convertColonRule = (cssText, regExp, partReplacer) => {
|
|
138
|
-
// m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
|
|
139
|
-
return cssText.replace(regExp, (...m) => {
|
|
140
|
-
if (m[2]) {
|
|
141
|
-
const parts = m[2].split(',');
|
|
142
|
-
const r = [];
|
|
143
|
-
for (let i = 0; i < parts.length; i++) {
|
|
144
|
-
const p = parts[i].trim();
|
|
145
|
-
if (!p)
|
|
146
|
-
break;
|
|
147
|
-
r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
|
|
148
|
-
}
|
|
149
|
-
return r.join(',');
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
return _polyfillHostNoCombinator + m[3];
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
const colonHostPartReplacer = (host, part, suffix) => {
|
|
157
|
-
return host + part.replace(_polyfillHost, '') + suffix;
|
|
158
|
-
};
|
|
159
|
-
const convertColonHost = (cssText) => {
|
|
160
|
-
return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
|
|
161
|
-
};
|
|
162
|
-
const colonHostContextPartReplacer = (host, part, suffix) => {
|
|
163
|
-
if (part.indexOf(_polyfillHost) > -1) {
|
|
164
|
-
return colonHostPartReplacer(host, part, suffix);
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
return host + part + suffix + ', ' + part + ' ' + host + suffix;
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
const convertColonSlotted = (cssText, slotScopeId) => {
|
|
171
|
-
const slotClass = '.' + slotScopeId + ' > ';
|
|
172
|
-
const selectors = [];
|
|
173
|
-
cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
|
|
174
|
-
if (m[2]) {
|
|
175
|
-
const compound = m[2].trim();
|
|
176
|
-
const suffix = m[3];
|
|
177
|
-
const slottedSelector = slotClass + compound + suffix;
|
|
178
|
-
let prefixSelector = '';
|
|
179
|
-
for (let i = m[4] - 1; i >= 0; i--) {
|
|
180
|
-
const char = m[5][i];
|
|
181
|
-
if (char === '}' || char === ',') {
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
prefixSelector = char + prefixSelector;
|
|
185
|
-
}
|
|
186
|
-
const orgSelector = prefixSelector + slottedSelector;
|
|
187
|
-
const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
|
|
188
|
-
if (orgSelector.trim() !== addedSelector.trim()) {
|
|
189
|
-
const updatedSelector = `${addedSelector}, ${orgSelector}`;
|
|
190
|
-
selectors.push({
|
|
191
|
-
orgSelector,
|
|
192
|
-
updatedSelector,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
return slottedSelector;
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
return _polyfillHostNoCombinator + m[3];
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
return {
|
|
202
|
-
selectors,
|
|
203
|
-
cssText,
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
const convertColonHostContext = (cssText) => {
|
|
207
|
-
return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
|
|
208
|
-
};
|
|
209
|
-
const convertShadowDOMSelectors = (cssText) => {
|
|
210
|
-
return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
|
|
211
|
-
};
|
|
212
|
-
const makeScopeMatcher = (scopeSelector) => {
|
|
213
|
-
const lre = /\[/g;
|
|
214
|
-
const rre = /\]/g;
|
|
215
|
-
scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
|
|
216
|
-
return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
|
|
217
|
-
};
|
|
218
|
-
const selectorNeedsScoping = (selector, scopeSelector) => {
|
|
219
|
-
const re = makeScopeMatcher(scopeSelector);
|
|
220
|
-
return !re.test(selector);
|
|
221
|
-
};
|
|
222
|
-
const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
|
|
223
|
-
// In Android browser, the lastIndex is not reset when the regex is used in String.replace()
|
|
224
|
-
_polyfillHostRe.lastIndex = 0;
|
|
225
|
-
if (_polyfillHostRe.test(selector)) {
|
|
226
|
-
const replaceBy = `.${hostSelector}`;
|
|
227
|
-
return selector
|
|
228
|
-
.replace(_polyfillHostNoCombinatorRe, (_, selector) => {
|
|
229
|
-
return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
|
|
230
|
-
return before + replaceBy + colon + after;
|
|
231
|
-
});
|
|
232
|
-
})
|
|
233
|
-
.replace(_polyfillHostRe, replaceBy + ' ');
|
|
234
|
-
}
|
|
235
|
-
return scopeSelector + ' ' + selector;
|
|
236
|
-
};
|
|
237
|
-
const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
|
|
238
|
-
const isRe = /\[is=([^\]]*)\]/g;
|
|
239
|
-
scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
|
|
240
|
-
const className = '.' + scopeSelector;
|
|
241
|
-
const _scopeSelectorPart = (p) => {
|
|
242
|
-
let scopedP = p.trim();
|
|
243
|
-
if (!scopedP) {
|
|
244
|
-
return '';
|
|
245
|
-
}
|
|
246
|
-
if (p.indexOf(_polyfillHostNoCombinator) > -1) {
|
|
247
|
-
scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
// remove :host since it should be unnecessary
|
|
251
|
-
const t = p.replace(_polyfillHostRe, '');
|
|
252
|
-
if (t.length > 0) {
|
|
253
|
-
const matches = t.match(/([^:]*)(:*)(.*)/);
|
|
254
|
-
if (matches) {
|
|
255
|
-
scopedP = matches[1] + className + matches[2] + matches[3];
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
return scopedP;
|
|
260
|
-
};
|
|
261
|
-
const safeContent = safeSelector(selector);
|
|
262
|
-
selector = safeContent.content;
|
|
263
|
-
let scopedSelector = '';
|
|
264
|
-
let startIndex = 0;
|
|
265
|
-
let res;
|
|
266
|
-
const sep = /( |>|\+|~(?!=))\s*/g;
|
|
267
|
-
// If a selector appears before :host it should not be shimmed as it
|
|
268
|
-
// matches on ancestor elements and not on elements in the host's shadow
|
|
269
|
-
// `:host-context(div)` is transformed to
|
|
270
|
-
// `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
|
|
271
|
-
// the `div` is not part of the component in the 2nd selectors and should not be scoped.
|
|
272
|
-
// Historically `component-tag:host` was matching the component so we also want to preserve
|
|
273
|
-
// this behavior to avoid breaking legacy apps (it should not match).
|
|
274
|
-
// The behavior should be:
|
|
275
|
-
// - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
|
|
276
|
-
// - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
|
|
277
|
-
// `:host-context(tag)`)
|
|
278
|
-
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
|
279
|
-
// Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
|
|
280
|
-
let shouldScope = !hasHost;
|
|
281
|
-
while ((res = sep.exec(selector)) !== null) {
|
|
282
|
-
const separator = res[1];
|
|
283
|
-
const part = selector.slice(startIndex, res.index).trim();
|
|
284
|
-
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
|
285
|
-
const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
|
|
286
|
-
scopedSelector += `${scopedPart} ${separator} `;
|
|
287
|
-
startIndex = sep.lastIndex;
|
|
288
|
-
}
|
|
289
|
-
const part = selector.substring(startIndex);
|
|
290
|
-
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
|
291
|
-
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
|
|
292
|
-
// replace the placeholders with their original values
|
|
293
|
-
return restoreSafeSelector(safeContent.placeholders, scopedSelector);
|
|
294
|
-
};
|
|
295
|
-
const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
|
|
296
|
-
return selector
|
|
297
|
-
.split(',')
|
|
298
|
-
.map((shallowPart) => {
|
|
299
|
-
if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
|
|
300
|
-
return shallowPart.trim();
|
|
301
|
-
}
|
|
302
|
-
if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
|
|
303
|
-
return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
return shallowPart.trim();
|
|
307
|
-
}
|
|
308
|
-
})
|
|
309
|
-
.join(', ');
|
|
310
|
-
};
|
|
311
|
-
const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
|
|
312
|
-
return processRules(cssText, (rule) => {
|
|
313
|
-
let selector = rule.selector;
|
|
314
|
-
let content = rule.content;
|
|
315
|
-
if (rule.selector[0] !== '@') {
|
|
316
|
-
selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
|
|
317
|
-
}
|
|
318
|
-
else if (rule.selector.startsWith('@media') ||
|
|
319
|
-
rule.selector.startsWith('@supports') ||
|
|
320
|
-
rule.selector.startsWith('@page') ||
|
|
321
|
-
rule.selector.startsWith('@document')) {
|
|
322
|
-
content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
|
|
323
|
-
}
|
|
324
|
-
const cssRule = {
|
|
325
|
-
selector: selector.replace(/\s{2,}/g, ' ').trim(),
|
|
326
|
-
content,
|
|
327
|
-
};
|
|
328
|
-
return cssRule;
|
|
329
|
-
});
|
|
330
|
-
};
|
|
331
|
-
const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
|
|
332
|
-
cssText = insertPolyfillHostInCssText(cssText);
|
|
333
|
-
cssText = convertColonHost(cssText);
|
|
334
|
-
cssText = convertColonHostContext(cssText);
|
|
335
|
-
const slotted = convertColonSlotted(cssText, slotScopeId);
|
|
336
|
-
cssText = slotted.cssText;
|
|
337
|
-
cssText = convertShadowDOMSelectors(cssText);
|
|
338
|
-
if (scopeId) {
|
|
339
|
-
cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
|
|
340
|
-
}
|
|
341
|
-
cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
|
|
342
|
-
cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
|
|
343
|
-
return {
|
|
344
|
-
cssText: cssText.trim(),
|
|
345
|
-
slottedSelectors: slotted.selectors,
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
|
-
const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
|
349
|
-
const hostScopeId = scopeId + '-h';
|
|
350
|
-
const slotScopeId = scopeId + '-s';
|
|
351
|
-
const commentsWithHash = extractCommentsWithHash(cssText);
|
|
352
|
-
cssText = stripComments(cssText);
|
|
353
|
-
const orgSelectors = [];
|
|
354
|
-
if (commentOriginalSelector) {
|
|
355
|
-
const processCommentedSelector = (rule) => {
|
|
356
|
-
const placeholder = `/*!@___${orgSelectors.length}___*/`;
|
|
357
|
-
const comment = `/*!@${rule.selector}*/`;
|
|
358
|
-
orgSelectors.push({ placeholder, comment });
|
|
359
|
-
rule.selector = placeholder + rule.selector;
|
|
360
|
-
return rule;
|
|
361
|
-
};
|
|
362
|
-
cssText = processRules(cssText, (rule) => {
|
|
363
|
-
if (rule.selector[0] !== '@') {
|
|
364
|
-
return processCommentedSelector(rule);
|
|
365
|
-
}
|
|
366
|
-
else if (rule.selector.startsWith('@media') ||
|
|
367
|
-
rule.selector.startsWith('@supports') ||
|
|
368
|
-
rule.selector.startsWith('@page') ||
|
|
369
|
-
rule.selector.startsWith('@document')) {
|
|
370
|
-
rule.content = processRules(rule.content, processCommentedSelector);
|
|
371
|
-
return rule;
|
|
372
|
-
}
|
|
373
|
-
return rule;
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
|
|
377
|
-
cssText = [scoped.cssText, ...commentsWithHash].join('\n');
|
|
378
|
-
if (commentOriginalSelector) {
|
|
379
|
-
orgSelectors.forEach(({ placeholder, comment }) => {
|
|
380
|
-
cssText = cssText.replace(placeholder, comment);
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
scoped.slottedSelectors.forEach((slottedSelector) => {
|
|
384
|
-
cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
|
|
385
|
-
});
|
|
386
|
-
return cssText;
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
export { scopeCss };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, j as getElement } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ".sc-smoothly-accordion-item-h{display:block}[hidden].sc-smoothly-accordion-item-h{display:none}details.sc-smoothly-accordion-item{padding:0}details.sc-smoothly-accordion-item>summary.sc-smoothly-accordion-item>span.sc-smoothly-accordion-item{float:right;margin:0.2em;font-size:60%}details.sc-smoothly-accordion-item>summary.sc-smoothly-accordion-item{font-size:120%;list-style-type:none;cursor:pointer;padding:0.4em;color:rgb(var(--smoothly-text-tint))}details.sc-smoothly-accordion-item>fieldset.sc-smoothly-accordion-item{border:none;margin:0;padding:0}[open].sc-smoothly-accordion-item-h>details.sc-smoothly-accordion-item>summary.sc-smoothly-accordion-item{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color))}details.sc-smoothly-accordion-item>summary.sc-smoothly-accordion-item::-webkit-details-marker{display:none}details.sc-smoothly-accordion-item>summary.sc-smoothly-accordion-item>svg.sc-smoothly-accordion-item{width:1em;height:auto;margin-bottom:-0.2em;margin-right:0.4em}[open].sc-smoothly-accordion-item-h>details.sc-smoothly-accordion-item>summary.sc-smoothly-accordion-item>svg.sc-smoothly-accordion-item{fill:rgb(var(--smoothly-primary-contrast))}.sc-smoothly-accordion-item-h:not([open])>details.sc-smoothly-accordion-item>summary.sc-smoothly-accordion-item>svg.sc-smoothly-accordion-item{fill:rgb(var(--smoothly-text-tint))}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyAccordionItem = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.smoothlyAccordionItemDidLoad = createEvent(this, "smoothlyAccordionItemDidLoad", 7);
|
|
9
|
-
this.smoothlyAccordionItemDidUnload = createEvent(this, "smoothlyAccordionItemDidUnload", 7);
|
|
10
|
-
this.smoothlyOpen = createEvent(this, "smoothlyOpen", 7);
|
|
11
|
-
this.smoothlyClose = createEvent(this, "smoothlyClose", 7);
|
|
12
|
-
}
|
|
13
|
-
openChanged(isChecked) {
|
|
14
|
-
this.open = isChecked;
|
|
15
|
-
if (isChecked) {
|
|
16
|
-
this.smoothlyOpen.emit({
|
|
17
|
-
open: true,
|
|
18
|
-
name: this.name,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
componentDidLoad() {
|
|
23
|
-
const summary = this.me.getElementsByTagName("summary");
|
|
24
|
-
if (summary.length > 0) {
|
|
25
|
-
const onClick = (e) => {
|
|
26
|
-
if (this.open)
|
|
27
|
-
this.smoothlyClose.emit({ open: this.open, name: this.name });
|
|
28
|
-
else
|
|
29
|
-
this.open = true;
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
};
|
|
32
|
-
summary[0].addEventListener("click", onClick);
|
|
33
|
-
summary[0].addEventListener("touch", onClick);
|
|
34
|
-
}
|
|
35
|
-
this.smoothlyAccordionItemDidLoad.emit();
|
|
36
|
-
}
|
|
37
|
-
disconnectedCallback() {
|
|
38
|
-
this.smoothlyAccordionItemDidUnload.emit();
|
|
39
|
-
}
|
|
40
|
-
render() {
|
|
41
|
-
return (h("details", { open: this.open }, h("summary", null, this.open ? (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 48C141.6 48 48 141.6 48 256s93.6 208 208 208 208-93.6 208-208S370.4 48 256 48zm-42.7 318.9L106.7 260.3l29.9-29.9 76.8 76.8 162.1-162.1 29.9 29.9-192.1 191.9z" }))) : (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { d: "M256 48C141.601 48 48 141.601 48 256s93.601 208 208 208 208-93.601 208-208S370.399 48 256 48zm0 374.399c-91.518 0-166.399-74.882-166.399-166.399S164.482 89.6 256 89.6 422.4 164.482 422.4 256 347.518 422.399 256 422.399z" }))), this.name, typeof this.brand == "string" ? (h("span", { class: this.brand.toLowerCase() }, this.brand)) : Array.isArray(this.brand) ? (this.brand.map(b => h("span", { class: b.toLowerCase() }, b))) : ([])), h("fieldset", { disabled: !this.open, name: this.name }, h("slot", null))));
|
|
42
|
-
}
|
|
43
|
-
get me() { return getElement(this); }
|
|
44
|
-
static get watchers() { return {
|
|
45
|
-
"open": ["openChanged"]
|
|
46
|
-
}; }
|
|
47
|
-
};
|
|
48
|
-
SmoothlyAccordionItem.style = styleCss;
|
|
49
|
-
|
|
50
|
-
export { SmoothlyAccordionItem as smoothly_accordion_item };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, j as getElement } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = "smoothly-accordion-item.sc-smoothly-accordion{border:1px solid rgb(var(--smoothly-dark-color));border-bottom:none}smoothly-accordion-item.sc-smoothly-accordion:first-of-type{border-top-left-radius:4px;border-top-right-radius:4px;margin-top:0.4em}smoothly-accordion-item.sc-smoothly-accordion:last-of-type{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:1px solid rgb(var(--smoothly-dark-color));margin-bottom:0.6em}smoothly-accordion-item[open].sc-smoothly-accordion{border-color:rgb(var(--smoothly-primary-color));border-bottom:1px solid rgb(var(--smoothly-primary-color))}smoothly-accordion-item[open].sc-smoothly-accordion+smoothly-accordion-item.sc-smoothly-accordion{border-top:none}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyAccordion = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.items = [];
|
|
9
|
-
}
|
|
10
|
-
valueChanged(value) {
|
|
11
|
-
this.updateItems();
|
|
12
|
-
}
|
|
13
|
-
handleOpenClose(event) {
|
|
14
|
-
if (event.detail.open)
|
|
15
|
-
this.value = event.detail.name;
|
|
16
|
-
else if (this.value == event.detail.name)
|
|
17
|
-
this.value = undefined;
|
|
18
|
-
}
|
|
19
|
-
onAccordionItemDidLoad(ev) {
|
|
20
|
-
const item = ev.target;
|
|
21
|
-
this.items.push(item);
|
|
22
|
-
if (this.value == undefined && item.open)
|
|
23
|
-
this.value = item.name;
|
|
24
|
-
else
|
|
25
|
-
this.updateItems();
|
|
26
|
-
}
|
|
27
|
-
onAccordionItemDidUnload(ev) {
|
|
28
|
-
const index = this.items.indexOf(ev.target);
|
|
29
|
-
if (index > -1)
|
|
30
|
-
this.items.splice(index, 1);
|
|
31
|
-
}
|
|
32
|
-
componentDidLoad() {
|
|
33
|
-
this.updateItems();
|
|
34
|
-
}
|
|
35
|
-
updateItems() {
|
|
36
|
-
let hasChecked = false;
|
|
37
|
-
for (const item of this.items)
|
|
38
|
-
if ((item.open = !hasChecked && item.name == this.value))
|
|
39
|
-
hasChecked = true;
|
|
40
|
-
}
|
|
41
|
-
render() {
|
|
42
|
-
return [h("slot", null)];
|
|
43
|
-
}
|
|
44
|
-
get me() { return getElement(this); }
|
|
45
|
-
static get watchers() { return {
|
|
46
|
-
"value": ["valueChanged"]
|
|
47
|
-
}; }
|
|
48
|
-
};
|
|
49
|
-
SmoothlyAccordion.style = styleCss;
|
|
50
|
-
|
|
51
|
-
export { SmoothlyAccordion as smoothly_accordion };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-02a70ac1.js';
|
|
2
|
-
import { A as App } from './App-22187759.js';
|
|
3
|
-
|
|
4
|
-
let SmoothlyAppDemo = class {
|
|
5
|
-
constructor(hostRef) {
|
|
6
|
-
registerInstance(this, hostRef);
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return (h(App, { label: "Smoothly Demo" }, h("a", { slot: "nav-start", href: "display" }, "Display"), h("a", { slot: "nav-start", href: "https://google.com" }, "External"), h("smoothly-room", { path: "" }, h("smoothly-input", { type: "text" }, "Default")), h("smoothly-room", { path: "input", label: "Input" }, h("smoothly-input-demo", null)), h("smoothly-room", { path: "dialog", label: "Dialog" }, h("smoothly-dialog-demo", null)), h("smoothly-room", { path: "display", label: "Display", icon: "eye-outline" }, h("smoothly-display-demo", null)), h("smoothly-room", { path: "table", label: "Table" }, h("smoothly-table-demo", null)), h("smoothly-room", { path: "select", label: "Select" }, h("smoothly-select-demo", null)), h("smoothly-room", { path: "icon", label: "Icon" }, h("smoothly-icon-demo", null)), h("smoothly-room", { path: "old", label: "Old", to: "select" }), h("span", { slot: "header", style: { width: "100%", maxWidth: "500px" } }, h("smoothly-picker", { label: "All Animals Selected", style: { minWidth: "100px" }, labelSetting: "hide", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, "select-none-name": "Select All", options: [
|
|
10
|
-
{ name: "Big Dog", value: "dog", aliases: ["WOFF"] },
|
|
11
|
-
{ name: "Cat Stevens", value: "cat", aliases: ["moew"], right: "🐈" },
|
|
12
|
-
{ name: "Noble Pig", value: "pig", right: "🐷" },
|
|
13
|
-
{ name: "Turtle Wax", value: "turtle", right: "" },
|
|
14
|
-
{ name: "Spider Man", value: "spider", right: "" },
|
|
15
|
-
{ name: "Phoenix Order Long Wooord", value: "phoenix", right: "" },
|
|
16
|
-
{ name: "Horse Back", value: "horse", right: "" },
|
|
17
|
-
{ name: "Unicorn Horn", value: "unicorn", right: "" },
|
|
18
|
-
{ name: "Talking Parrot Parrot", value: "parrot", right: "" },
|
|
19
|
-
{ name: "Hidden Dragon", value: "dragon", right: "" },
|
|
20
|
-
{ name: "Scary Kraken", value: "kraken", right: "" },
|
|
21
|
-
] })), h("smoothly-trigger", { slot: "header", type: "link", name: "logout" }, h("smoothly-icon", { toolTip: "Log out", name: "log-out", size: "medium" }))));
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { SmoothlyAppDemo as smoothly_app_demo };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = "smoothly-app{display:block;scrollbar-width:none}smoothly-app[hidden]{display:none}smoothly-app[color=default],smoothly-app:not([color]){--smoothly-app-background:var(--smoothly-default-color);--smoothly-app-color:var(--smoothly-default-contrast);--smoothly-app-hover-background:var(--smoothly-primary-color);--smoothly-app-hover-color:var(--smoothly-primary-contrast);--smoothly-app-shadow:var(--smoothly-default-shadow)}smoothly-app[color=primary]{--smoothly-app-background:var(--smoothly-primary-shade);--smoothly-app-color:var(--smoothly-primary-contrast);--smoothly-app-hover-background:var(--smoothly-secondary-color);--smoothly-app-hover-color:var(--smoothly-secondary-contrast);--smoothly-app-shadow:var(--smoothly-primary-shadow)}smoothly-app[color=secondary]{--smoothly-app-background:var(--smoothly-secondary-shade);--smoothly-app-color:var(--smoothly-secondary-contrast);--smoothly-app-hover-background:var(--smoothly-primary-color);--smoothly-app-hover-color:var(--smoothly-primary-contrast);--smoothly-app-shadow:var(--smoothly-secondary-shadow)}smoothly-app[color=tertiary],smoothly-app[color=success],smoothly-app[color=warning],smoothly-app[color=danger]{--smoothly-app-background:var(--smoothly-color-shade);--smoothly-app-color:var(--smoothly-color-contrast);--smoothly-app-hover-background:var(--smoothly-default-shade);--smoothly-app-hover-color:var(--smoothly-default-contrast);--smoothly-app-shadow:var(--smoothly-color-shadow)}smoothly-app>smoothly-notifier>header{position:fixed;top:0;left:0;width:100%;z-index:5;height:90px;background-color:rgb(var(--smoothly-app-background));color:rgba(var(--smoothly-medium-color));fill:rgb(var(--smoothly-medium-color));stroke:rgb(var(--smoothly-medium-color));display:flex;font-size:18px;justify-content:space-between;align-items:center;box-shadow:0 2px 5px 0 rgba(var(--smoothly-app-shadow));border-bottom:1px solid rgba(var(--smoothly-dark-color))}smoothly-app>smoothly-notifier>header a{color:inherit;text-decoration:inherit}smoothly-app>smoothly-notifier>header>nav{width:100%;flex-shrink:2}smoothly-app>smoothly-notifier>header>h1,smoothly-app>smoothly-notifier>header>nav,smoothly-app>smoothly-notifier>header>nav>ul,smoothly-app>smoothly-notifier>header>nav>ul>li,smoothly-app>smoothly-notifier>header>nav>ul>li>*:not(a){display:flex;height:100%;margin:0}smoothly-app>smoothly-notifier>header>h1{margin-left:60px}smoothly-app>smoothly-notifier>header>h1>a{overflow:hidden;user-select:none;height:200%;display:flex;align-self:center;size:100%;background-position-y:center}smoothly-app>smoothly-notifier>header>nav>ul>li a{line-height:1.6cm}smoothly-app>smoothly-notifier>header>nav>ul{width:100%}smoothly-app>smoothly-notifier>header>[slot=header]{display:flex;margin-right:34.25px;justify-content:flex-end;border:0}smoothly-app>smoothly-notifier>header>[slot=header]>a{display:flex;align-self:center;border-width:0;align-items:center;margin-right:62.25px}smoothly-app>smoothly-notifier>header>[slot=header]>a>smoothly-icon{fill:rgb(var(--smoothly-primary-shade));stroke:rgb(var(--smoothly-primary-shade));color:rgb(var(--smoothly-primary-shade))}smoothly-app>smoothly-notifier>header>nav>ul>li a{display:flex;height:36px;margin:0 0.4cm;text-decoration:none}smoothly-app>smoothly-notifier>header>nav>ul>li>a{display:flex;align-items:center;align-self:center;margin-bottom:2px}smoothly-app>smoothly-notifier>header>nav>ul>li smoothly-trigger.sc-smoothly-trigger-h{border:0}smoothly-app>smoothly-notifier>header>nav>ul>li>a>smoothly-icon>svg{fill:rgb(var(--smoothly-medium-color));stroke:rgb(var(--smoothly-medium-color));color:rgb(var(--smoothly-medium-color));align-items:center;display:flex}smoothly-app>smoothly-notifier>header>nav>ul>li>a:hover>smoothly-icon>svg,smoothly-app>smoothly-notifier>header>nav>ul>li>a.active>smoothly-icon>svg{color:rgb(var(--smoothly-app-color));stroke:rgb(var(--smoothly-app-color));fill:rgb(var(--smoothly-app-color))}smoothly-app>smoothly-notifier>header>nav>ul>li>smoothly-trigger.active a>smoothly-icon,smoothly-app>smoothly-notifier>header>nav>ul>li>smoothly-trigger:hover a>smoothly-icon,smoothly-app>smoothly-notifier>header>nav>ul>li a:hover,smoothly-app>smoothly-notifier>header>nav>ul>li a.active{border-bottom:2px solid rgb(var(--smoothly-app-color));margin-bottom:0px;border-bottom-width:2px;color:rgb(var(--smoothly-app-color));stroke:rgb(var(--smoothly-app-color));fill:rgb(var(--smoothly-app-color))}smoothly-app>smoothly-notifier>main{position:relative;top:90px}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyApp = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return (h("smoothly-notifier", null, h("slot", null)));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
SmoothlyApp.style = styleCss;
|
|
14
|
-
|
|
15
|
-
export { SmoothlyApp as smoothly_app };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, k as Host } from './index-02a70ac1.js';
|
|
2
|
-
|
|
3
|
-
const styleCss = ".sc-smoothly-backtotop-h{background-color:rgba(var(--smoothly-default-color), 1);opacity:var(--opacity);pointer-events:var(--pointer-events);transition:opacity 400ms;z-index:3;border-radius:50%;box-shadow:var(--smoothly-shadow);height:3rem;width:3rem;position:fixed;bottom:var(--bottom);right:var(--right);outline:none;cursor:pointer;display:flex;justify-content:center;align-items:center}";
|
|
4
|
-
|
|
5
|
-
let SmoothlyBacktotop = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.opacity = "0.5";
|
|
9
|
-
this.bottom = "1rem";
|
|
10
|
-
this.right = "1rem";
|
|
11
|
-
}
|
|
12
|
-
componentWillLoad() {
|
|
13
|
-
window.addEventListener("scroll", () => {
|
|
14
|
-
this.visible = document.body.scrollTop > 20 || document.documentElement.scrollTop > 20;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
const cssVariables = {
|
|
19
|
-
"--opacity": this.visible ? this.opacity : "0",
|
|
20
|
-
"--pointer-events": this.visible ? "auto" : "none",
|
|
21
|
-
"--bottom": this.bottom,
|
|
22
|
-
"--right": this.right,
|
|
23
|
-
};
|
|
24
|
-
return (h(Host, { style: cssVariables, onClick: () => window.scrollTo({
|
|
25
|
-
top: 0,
|
|
26
|
-
left: 0,
|
|
27
|
-
behavior: "smooth",
|
|
28
|
-
}) }, h("smoothly-icon", { name: "chevron-up-outline" })));
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
SmoothlyBacktotop.style = styleCss;
|
|
32
|
-
|
|
33
|
-
export { SmoothlyBacktotop as smoothly_backtotop };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, j as getElement } from './index-02a70ac1.js';
|
|
2
|
-
import { d as dist } from './index-a5a08f46.js';
|
|
3
|
-
import { w as weekdays, m as month } from './generate-50b98474.js';
|
|
4
|
-
import './_commonjsHelpers-8fe71198.js';
|
|
5
|
-
|
|
6
|
-
const styleCss = ".sc-smoothly-calendar-h{display:block;--other-month-opacity:0.5}.sc-smoothly-calendar-h>smoothly-input-month.sc-smoothly-calendar{width:calc(100% - 1em);padding:0.5em 0.5em 0 0.5em}th.sc-smoothly-calendar,td.sc-smoothly-calendar{text-align:center;padding:0.5em;min-width:2em;background-color:rgb(var(--smoothly-default-shade));cursor:pointer;user-select:none}td.currentMonth.sc-smoothly-calendar{color:rgb(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:not(.currentMonth){color:rgba(var(--smoothly-default-contrast), var(--other-month-opacity))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).dateRange,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).dateRange{color:rgba(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:nth-child(6),td.sc-smoothly-calendar:nth-child(7){color:rgb(var(--smoothly-danger-tint))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth),td.sc-smoothly-calendar:nth-child(7):not(.currentMonth){color:rgba(var(--smoothly-danger-tint), var(--other-month-opacity))}td.sc-smoothly-calendar:not(.selected,.disable).sc-smoothly-calendar:hover{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}td.selected.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color))}td.sc-smoothly-calendar:not(.selected,.dateRange).sc-smoothly-calendar:not(:hover).today{background:rgb(var(--smoothly-dark-tint));color:rgb(var(--smoothly-dark-contrast))}td.dateRange.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}td.disable.sc-smoothly-calendar{cursor:not-allowed;background-color:rgb(var(--smoothly-default-tint), 0.5);color:rgb(var(--smoothly-default-contrast), 0.5)}";
|
|
7
|
-
|
|
8
|
-
let Calendar = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
12
|
-
this.startChanged = createEvent(this, "startChanged", 7);
|
|
13
|
-
this.endChanged = createEvent(this, "endChanged", 7);
|
|
14
|
-
this.dateSet = createEvent(this, "dateSet", 7);
|
|
15
|
-
this.dateRangeSet = createEvent(this, "dateRangeSet", 7);
|
|
16
|
-
this.value = dist.Date.now();
|
|
17
|
-
this.clickCounter = 0;
|
|
18
|
-
}
|
|
19
|
-
onStart(next) {
|
|
20
|
-
this.startChanged.emit(next);
|
|
21
|
-
}
|
|
22
|
-
onEnd(next) {
|
|
23
|
-
this.endChanged.emit(next);
|
|
24
|
-
}
|
|
25
|
-
onClick(date) {
|
|
26
|
-
this.valueChanged.emit((this.value = date));
|
|
27
|
-
this.clickCounter += 1;
|
|
28
|
-
if (this.doubleInput) {
|
|
29
|
-
if (this.clickCounter % 2 == 1)
|
|
30
|
-
this.start = this.end = this.frozenDate = date;
|
|
31
|
-
else {
|
|
32
|
-
if (this.start && date > this.start)
|
|
33
|
-
this.end = date;
|
|
34
|
-
else
|
|
35
|
-
this.start = date;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
!this.doubleInput && this.dateSet.emit(this.value);
|
|
39
|
-
this.doubleInput &&
|
|
40
|
-
this.clickCounter % 2 == 0 &&
|
|
41
|
-
this.start &&
|
|
42
|
-
this.end &&
|
|
43
|
-
this.dateRangeSet.emit({ start: this.start, end: this.end });
|
|
44
|
-
}
|
|
45
|
-
onHover(date) {
|
|
46
|
-
if (this.doubleInput && this.clickCounter % 2 == 1) {
|
|
47
|
-
if (date < this.frozenDate) {
|
|
48
|
-
this.start = date;
|
|
49
|
-
this.end = this.frozenDate;
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
this.start = this.frozenDate;
|
|
53
|
-
this.end = date;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
var _a, _b;
|
|
59
|
-
return [
|
|
60
|
-
h("smoothly-input-month", { value: (_a = this.month) !== null && _a !== void 0 ? _a : this.value, onValueChanged: event => {
|
|
61
|
-
this.month = event.detail;
|
|
62
|
-
event.stopPropagation();
|
|
63
|
-
} }),
|
|
64
|
-
h("table", null, h("thead", null, h("tr", null, weekdays().map(day => (h("th", null, day))))), month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
|
|
65
|
-
var _a, _b, _c;
|
|
66
|
-
return (h("td", { tabindex: 1, onMouseOver: () => {
|
|
67
|
-
!this.doubleInput && (this.min || this.max) && (date < this.min || date > this.max)
|
|
68
|
-
? undefined
|
|
69
|
-
: this.onHover(date);
|
|
70
|
-
}, onClick: (this.min || this.max) && (date < this.min || date > this.max) ? undefined : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
71
|
-
.concat(...(date == dist.Date.now() ? ["today"] : []), dist.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == dist.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
72
|
-
? this.start == date || this.end == date
|
|
73
|
-
? ["selected"]
|
|
74
|
-
: date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
75
|
-
? ["dateRange"]
|
|
76
|
-
: []
|
|
77
|
-
: "")
|
|
78
|
-
.concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
|
|
79
|
-
.join(" ") }, date.substring(8, 10)));
|
|
80
|
-
}))))),
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
get element() { return getElement(this); }
|
|
84
|
-
static get watchers() { return {
|
|
85
|
-
"start": ["onStart"],
|
|
86
|
-
"end": ["onEnd"]
|
|
87
|
-
}; }
|
|
88
|
-
};
|
|
89
|
-
Calendar.style = styleCss;
|
|
90
|
-
|
|
91
|
-
export { Calendar as smoothly_calendar };
|