@api-client/ui 0.5.26 → 0.5.28
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/build/src/elements/app-bar/internals/AppBar.d.ts +1 -1
- package/build/src/elements/app-bar/internals/AppBar.d.ts.map +1 -1
- package/build/src/elements/app-bar/internals/AppBar.js +5 -5
- package/build/src/elements/app-bar/internals/AppBar.js.map +1 -1
- package/build/src/elements/currency/internals/Picker.d.ts +2 -2
- package/build/src/elements/currency/internals/Picker.d.ts.map +1 -1
- package/build/src/elements/currency/internals/Picker.js +13 -12
- package/build/src/elements/currency/internals/Picker.js.map +1 -1
- package/build/src/elements/data-table/DataTable.d.ts +1 -3
- package/build/src/elements/data-table/DataTable.d.ts.map +1 -1
- package/build/src/elements/data-table/DataTable.js +2 -4
- package/build/src/elements/data-table/DataTable.js.map +1 -1
- package/build/src/elements/file-system/internals/Breadcrumbs.d.ts +1 -2
- package/build/src/elements/file-system/internals/Breadcrumbs.d.ts.map +1 -1
- package/build/src/elements/file-system/internals/Breadcrumbs.js +2 -3
- package/build/src/elements/file-system/internals/Breadcrumbs.js.map +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.js +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.js.map +1 -1
- package/build/src/md/list/internals/List.d.ts +4 -2
- package/build/src/md/list/internals/List.d.ts.map +1 -1
- package/build/src/md/list/internals/List.js +16 -6
- package/build/src/md/list/internals/List.js.map +1 -1
- package/build/src/md/list/internals/ListItem.d.ts +10 -1
- package/build/src/md/list/internals/ListItem.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.js +74 -8
- package/build/src/md/list/internals/ListItem.js.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.js +38 -28
- package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
- package/build/src/md/menu/internal/MenuItem.js +4 -4
- package/build/src/md/menu/internal/MenuItem.js.map +1 -1
- package/build/src/md/progress/internals/CircularProgress.d.ts +93 -0
- package/build/src/md/progress/internals/CircularProgress.d.ts.map +1 -0
- package/build/src/md/progress/internals/CircularProgress.js +156 -0
- package/build/src/md/progress/internals/CircularProgress.js.map +1 -0
- package/build/src/md/progress/internals/CircularProgress.styles.d.ts +3 -0
- package/build/src/md/progress/internals/CircularProgress.styles.d.ts.map +1 -0
- package/build/src/md/progress/internals/CircularProgress.styles.js +220 -0
- package/build/src/md/progress/internals/CircularProgress.styles.js.map +1 -0
- package/build/src/md/progress/internals/Range.d.ts +6 -0
- package/build/src/md/progress/internals/Range.d.ts.map +1 -1
- package/build/src/md/progress/internals/Range.js +41 -3
- package/build/src/md/progress/internals/Range.js.map +1 -1
- package/build/src/md/progress/internals/UiProgress.d.ts +0 -7
- package/build/src/md/progress/internals/UiProgress.d.ts.map +1 -1
- package/build/src/md/progress/internals/UiProgress.js +2 -36
- package/build/src/md/progress/internals/UiProgress.js.map +1 -1
- package/build/src/md/progress/ui-circular-progress.d.ts +11 -0
- package/build/src/md/progress/ui-circular-progress.d.ts.map +1 -0
- package/build/src/md/progress/ui-circular-progress.js +27 -0
- package/build/src/md/progress/ui-circular-progress.js.map +1 -0
- package/build/src/md/select/internals/Option.js +2 -2
- package/build/src/md/select/internals/Option.js.map +1 -1
- package/build/src/md/select/internals/Option.styles.d.ts.map +1 -1
- package/build/src/md/select/internals/Option.styles.js +0 -127
- package/build/src/md/select/internals/Option.styles.js.map +1 -1
- package/build/src/md/select/internals/Select.d.ts +11 -1
- package/build/src/md/select/internals/Select.d.ts.map +1 -1
- package/build/src/md/select/internals/Select.js +21 -2
- package/build/src/md/select/internals/Select.js.map +1 -1
- package/demo/elements/currency/index.html +2 -2
- package/demo/elements/navigation/navigation-item.html +4 -0
- package/demo/elements/navigation/navigation-item.ts +19 -0
- package/demo/md/list/list.ts +9 -3
- package/demo/md/progress/progress.ts +24 -1
- package/demo/md/select/index.ts +5 -0
- package/demo/md/tabs/tabs.ts +0 -4
- package/package.json +1 -1
- package/src/elements/app-bar/internals/AppBar.ts +5 -5
- package/src/elements/currency/internals/Picker.ts +17 -16
- package/src/elements/data-table/DataTable.ts +2 -4
- package/src/elements/file-system/internals/Breadcrumbs.ts +2 -3
- package/src/elements/navigation/internals/NavigationItem.ts +1 -1
- package/src/md/list/internals/List.ts +19 -8
- package/src/md/list/internals/ListItem.styles.ts +38 -28
- package/src/md/list/internals/ListItem.ts +55 -8
- package/src/md/menu/internal/MenuItem.ts +4 -4
- package/src/md/progress/internals/CircularProgress.styles.ts +220 -0
- package/src/md/progress/internals/CircularProgress.ts +129 -0
- package/src/md/progress/internals/Range.ts +29 -1
- package/src/md/progress/internals/UiProgress.ts +1 -30
- package/src/md/progress/ui-circular-progress.ts +15 -0
- package/src/md/select/internals/Option.styles.ts +0 -127
- package/src/md/select/internals/Option.ts +2 -2
- package/src/md/select/internals/Select.ts +13 -1
- package/test/elements/currency/CurrencyPicker.accessibility.test.ts +14 -14
- package/test/elements/currency/CurrencyPicker.core.test.ts +6 -6
- package/test/elements/currency/CurrencyPicker.integration.test.ts +2 -2
- package/test/elements/currency/CurrencyPicker.test.ts +10 -10
- package/test/elements/data-table/DataTable.browser.test.ts +2 -2
- package/test/md/menu/MenuItem.test.ts +2 -3
- package/test/md/progress/UiCircularProgressElement.test.ts +481 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { isDisabled, setDisabled } from '../../../lib/disabled.js';
|
|
4
|
+
import { UiRange } from './Range.js';
|
|
5
|
+
import { html } from 'lit';
|
|
6
|
+
let CircularProgress = (() => {
|
|
7
|
+
let _classSuper = UiRange;
|
|
8
|
+
let _instanceExtraInitializers = [];
|
|
9
|
+
let _set_disabled_decorators;
|
|
10
|
+
let _fourColor_decorators;
|
|
11
|
+
let _fourColor_initializers = [];
|
|
12
|
+
let _fourColor_extraInitializers = [];
|
|
13
|
+
return class CircularProgress extends _classSuper {
|
|
14
|
+
static {
|
|
15
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
16
|
+
_set_disabled_decorators = [property({ reflect: true, type: Boolean })];
|
|
17
|
+
_fourColor_decorators = [property({ type: Boolean, reflect: true })];
|
|
18
|
+
__esDecorate(this, null, _set_disabled_decorators, { kind: "setter", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
19
|
+
__esDecorate(this, null, _fourColor_decorators, { kind: "accessor", name: "fourColor", static: false, private: false, access: { has: obj => "fourColor" in obj, get: obj => obj.fourColor, set: (obj, value) => { obj.fourColor = value; } }, metadata: _metadata }, _fourColor_initializers, _fourColor_extraInitializers);
|
|
20
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets the disabled state of the progress indicator.
|
|
24
|
+
* @returns True if the component is disabled, false otherwise.
|
|
25
|
+
*/
|
|
26
|
+
get disabled() {
|
|
27
|
+
return isDisabled(this);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sets the disabled state of the progress indicator.
|
|
31
|
+
* When disabled, the component may have reduced visual emphasis
|
|
32
|
+
* and should not respond to user interactions.
|
|
33
|
+
* @attribute
|
|
34
|
+
*/
|
|
35
|
+
set disabled(value) {
|
|
36
|
+
const old = isDisabled(this);
|
|
37
|
+
setDisabled(this, value);
|
|
38
|
+
this.requestUpdate('disabled', old);
|
|
39
|
+
}
|
|
40
|
+
#fourColor_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _fourColor_initializers, false
|
|
41
|
+
/**
|
|
42
|
+
* Renders the circular progress indicator.
|
|
43
|
+
*
|
|
44
|
+
* Chooses between determinate and indeterminate rendering based on the
|
|
45
|
+
* `indeterminate` property inherited from UiRange.
|
|
46
|
+
*
|
|
47
|
+
* @returns The template result for the progress indicator.
|
|
48
|
+
*/
|
|
49
|
+
));
|
|
50
|
+
/**
|
|
51
|
+
* Enables four-color animation for indeterminate progress indicators.
|
|
52
|
+
*
|
|
53
|
+
* When enabled, the indeterminate progress indicator cycles between four colors:
|
|
54
|
+
* - Primary color (--ui-circular-progress-four-color-active-indicator-one-color)
|
|
55
|
+
* - Primary container (--ui-circular-progress-four-color-active-indicator-two-color)
|
|
56
|
+
* - Tertiary color (--ui-circular-progress-four-color-active-indicator-three-color)
|
|
57
|
+
* - Tertiary container (--ui-circular-progress-four-color-active-indicator-four-color)
|
|
58
|
+
*
|
|
59
|
+
* This property only affects the appearance when `indeterminate` is true.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
* @attribute fourcolor
|
|
63
|
+
*/
|
|
64
|
+
get fourColor() { return this.#fourColor_accessor_storage; }
|
|
65
|
+
set fourColor(value) { this.#fourColor_accessor_storage = value; }
|
|
66
|
+
/**
|
|
67
|
+
* Renders the circular progress indicator.
|
|
68
|
+
*
|
|
69
|
+
* Chooses between determinate and indeterminate rendering based on the
|
|
70
|
+
* `indeterminate` property inherited from UiRange.
|
|
71
|
+
*
|
|
72
|
+
* @returns The template result for the progress indicator.
|
|
73
|
+
*/
|
|
74
|
+
render() {
|
|
75
|
+
if (this.indeterminate) {
|
|
76
|
+
return this.renderIndeterminateContainer();
|
|
77
|
+
}
|
|
78
|
+
return this.renderDeterminateContainer();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Renders the determinate progress indicator using SVG.
|
|
82
|
+
*
|
|
83
|
+
* Creates a circular progress bar that shows a specific progress value
|
|
84
|
+
* using stroke-dashoffset to control the visible portion of the circle.
|
|
85
|
+
* The progress is calculated based on the current value, min, and max properties.
|
|
86
|
+
*
|
|
87
|
+
* @returns SVG template with track and active track circles.
|
|
88
|
+
*/
|
|
89
|
+
renderDeterminateContainer() {
|
|
90
|
+
const dashOffset = (1 - this.value / this.max) * 100;
|
|
91
|
+
return html `
|
|
92
|
+
<svg viewBox="0 0 4800 4800">
|
|
93
|
+
<circle class="track" pathLength="100"></circle>
|
|
94
|
+
<circle class="active-track" pathLength="100" stroke-dashoffset=${dashOffset}></circle>
|
|
95
|
+
</svg>
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Renders the indeterminate progress indicator using CSS animations.
|
|
100
|
+
*
|
|
101
|
+
* Creates a spinning animation with two half-circles that expand and contract
|
|
102
|
+
* to create a continuous loading animation. The animation can cycle through
|
|
103
|
+
* multiple colors when the `fourColor` property is enabled.
|
|
104
|
+
*
|
|
105
|
+
* @returns HTML template with animated spinner elements.
|
|
106
|
+
*/
|
|
107
|
+
renderIndeterminateContainer() {
|
|
108
|
+
return html ` <div class="spinner">
|
|
109
|
+
<div class="left">
|
|
110
|
+
<div class="circle"></div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="right">
|
|
113
|
+
<div class="circle"></div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>`;
|
|
116
|
+
}
|
|
117
|
+
constructor() {
|
|
118
|
+
super(...arguments);
|
|
119
|
+
__runInitializers(this, _fourColor_extraInitializers);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
})();
|
|
123
|
+
/**
|
|
124
|
+
* A circular progress indicator component that displays progress in a circular format.
|
|
125
|
+
*
|
|
126
|
+
* This component supports both determinate and indeterminate progress states:
|
|
127
|
+
* - **Determinate**: Shows a specific progress value with a filled arc
|
|
128
|
+
* - **Indeterminate**: Shows continuous animation without a specific value
|
|
129
|
+
*
|
|
130
|
+
* The component inherits from UiRange and provides additional features like:
|
|
131
|
+
* - Four-color animation for indeterminate state
|
|
132
|
+
* - Material Design 3 styling
|
|
133
|
+
* - Accessibility support with proper ARIA attributes
|
|
134
|
+
* - Customizable size and colors via CSS custom properties
|
|
135
|
+
*
|
|
136
|
+
* ## Accessibility
|
|
137
|
+
*
|
|
138
|
+
* For accessibility compliance, you must provide an accessible name for the progress indicator.
|
|
139
|
+
* Use the `aria-label` attribute to describe what the progress represents:
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```html
|
|
143
|
+
* <!-- Basic determinate progress -->
|
|
144
|
+
* <ui-circular-progress value="50" max="100" aria-label="Upload progress"></ui-circular-progress>
|
|
145
|
+
*
|
|
146
|
+
* <!-- Indeterminate progress -->
|
|
147
|
+
* <ui-circular-progress indeterminate aria-label="Loading content"></ui-circular-progress>
|
|
148
|
+
*
|
|
149
|
+
* <!-- Four-color indeterminate progress -->
|
|
150
|
+
* <ui-circular-progress indeterminate fourcolor aria-label="Processing data"></ui-circular-progress>
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @fires ratiochange - Inherited from UiRange. Dispatched when the ratio computation changes.
|
|
154
|
+
*/
|
|
155
|
+
export default CircularProgress;
|
|
156
|
+
//# sourceMappingURL=CircularProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.js","sourceRoot":"","sources":["../../../../../src/md/progress/internals/CircularProgress.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAuB,IAAI,EAAE,MAAM,KAAK,CAAA;;sBAkCD,OAAO;;;;;;iBAAhC,gBAAiB,SAAQ,WAAO;;;wCAelD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCAqB1C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YApB3C,0LAAI,QAAQ,wEAIX;YAgB2C,gLAAS,SAAS,6BAAT,SAAS,6FAAQ;;;QAnCtE;;;WAGG;QACH,IAAI,QAAQ;YACV,OAAO,UAAU,CAAC,IAAI,CAAC,CAAA;QACzB,CAAC;QAED;;;;;WAKG;QAEH,IAAI,QAAQ,CAAC,KAAc;YACzB,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;YAC5B,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;YACxB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QACrC,CAAC;QAgB2C,+BApCzB,mDAAgB,mDAoC8B,KAAK;QAEtE;;;;;;;WAOG;WATmE;QAdtE;;;;;;;;;;;;;WAaG;QACyC,IAAS,SAAS,+CAAQ;QAA1B,IAAS,SAAS,qDAAQ;QAEtE;;;;;;;WAOG;QACgB,MAAM;YACvB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBACvB,OAAO,IAAI,CAAC,4BAA4B,EAAE,CAAA;YAC5C,CAAC;YACD,OAAO,IAAI,CAAC,0BAA0B,EAAE,CAAA;QAC1C,CAAC;QAED;;;;;;;;WAQG;QACK,0BAA0B;YAChC,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;YACpD,OAAO,IAAI,CAAA;;;0EAG2D,UAAU;;KAE/E,CAAA;QACH,CAAC;QAED;;;;;;;;WAQG;QACK,4BAA4B;YAClC,OAAO,IAAI,CAAA;;;;;;;WAOJ,CAAA;QACT,CAAC;;;;;;;AA1HH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,gCA2FC","sourcesContent":["import { property } from 'lit/decorators.js'\nimport { isDisabled, setDisabled } from '../../../lib/disabled.js'\nimport { UiRange } from './Range.js'\nimport { type TemplateResult, html } from 'lit'\n\n/**\n * A circular progress indicator component that displays progress in a circular format.\n *\n * This component supports both determinate and indeterminate progress states:\n * - **Determinate**: Shows a specific progress value with a filled arc\n * - **Indeterminate**: Shows continuous animation without a specific value\n *\n * The component inherits from UiRange and provides additional features like:\n * - Four-color animation for indeterminate state\n * - Material Design 3 styling\n * - Accessibility support with proper ARIA attributes\n * - Customizable size and colors via CSS custom properties\n *\n * ## Accessibility\n *\n * For accessibility compliance, you must provide an accessible name for the progress indicator.\n * Use the `aria-label` attribute to describe what the progress represents:\n *\n * @example\n * ```html\n * <!-- Basic determinate progress -->\n * <ui-circular-progress value=\"50\" max=\"100\" aria-label=\"Upload progress\"></ui-circular-progress>\n *\n * <!-- Indeterminate progress -->\n * <ui-circular-progress indeterminate aria-label=\"Loading content\"></ui-circular-progress>\n *\n * <!-- Four-color indeterminate progress -->\n * <ui-circular-progress indeterminate fourcolor aria-label=\"Processing data\"></ui-circular-progress>\n * ```\n *\n * @fires ratiochange - Inherited from UiRange. Dispatched when the ratio computation changes.\n */\nexport default class CircularProgress extends UiRange {\n /**\n * Gets the disabled state of the progress indicator.\n * @returns True if the component is disabled, false otherwise.\n */\n get disabled(): boolean {\n return isDisabled(this)\n }\n\n /**\n * Sets the disabled state of the progress indicator.\n * When disabled, the component may have reduced visual emphasis\n * and should not respond to user interactions.\n * @attribute\n */\n @property({ reflect: true, type: Boolean })\n set disabled(value: boolean) {\n const old = isDisabled(this)\n setDisabled(this, value)\n this.requestUpdate('disabled', old)\n }\n\n /**\n * Enables four-color animation for indeterminate progress indicators.\n *\n * When enabled, the indeterminate progress indicator cycles between four colors:\n * - Primary color (--ui-circular-progress-four-color-active-indicator-one-color)\n * - Primary container (--ui-circular-progress-four-color-active-indicator-two-color)\n * - Tertiary color (--ui-circular-progress-four-color-active-indicator-three-color)\n * - Tertiary container (--ui-circular-progress-four-color-active-indicator-four-color)\n *\n * This property only affects the appearance when `indeterminate` is true.\n *\n * @default false\n * @attribute fourcolor\n */\n @property({ type: Boolean, reflect: true }) accessor fourColor = false\n\n /**\n * Renders the circular progress indicator.\n *\n * Chooses between determinate and indeterminate rendering based on the\n * `indeterminate` property inherited from UiRange.\n *\n * @returns The template result for the progress indicator.\n */\n protected override render(): TemplateResult {\n if (this.indeterminate) {\n return this.renderIndeterminateContainer()\n }\n return this.renderDeterminateContainer()\n }\n\n /**\n * Renders the determinate progress indicator using SVG.\n *\n * Creates a circular progress bar that shows a specific progress value\n * using stroke-dashoffset to control the visible portion of the circle.\n * The progress is calculated based on the current value, min, and max properties.\n *\n * @returns SVG template with track and active track circles.\n */\n private renderDeterminateContainer() {\n const dashOffset = (1 - this.value / this.max) * 100\n return html`\n <svg viewBox=\"0 0 4800 4800\">\n <circle class=\"track\" pathLength=\"100\"></circle>\n <circle class=\"active-track\" pathLength=\"100\" stroke-dashoffset=${dashOffset}></circle>\n </svg>\n `\n }\n\n /**\n * Renders the indeterminate progress indicator using CSS animations.\n *\n * Creates a spinning animation with two half-circles that expand and contract\n * to create a continuous loading animation. The animation can cycle through\n * multiple colors when the `fourColor` property is enabled.\n *\n * @returns HTML template with animated spinner elements.\n */\n private renderIndeterminateContainer() {\n return html` <div class=\"spinner\">\n <div class=\"left\">\n <div class=\"circle\"></div>\n </div>\n <div class=\"right\">\n <div class=\"circle\"></div>\n </div>\n </div>`\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.styles.d.ts","sourceRoot":"","sources":["../../../../../src/md/progress/internals/CircularProgress.styles.ts"],"names":[],"mappings":";AAEA,wBAyNC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css `
|
|
3
|
+
:host {
|
|
4
|
+
--ui-circular-progress-arc-duration: 1333ms;
|
|
5
|
+
--ui-circular-progress-cycle-duration: calc(4 * var(--ui-circular-progress-arc-duration));
|
|
6
|
+
--ui-circular-progress-linear-rotate-duration: calc(var(--ui-circular-progress-arc-duration) * 360 / 306);
|
|
7
|
+
--ui-circular-progress-indeterminate-easing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
8
|
+
--_container-padding: 4px;
|
|
9
|
+
--_size: var(--ui-circular-progress-size, 48px);
|
|
10
|
+
|
|
11
|
+
--_active-indicator-color: var(--ui-circular-progress-active-indicator-color, var(--md-sys-color-primary));
|
|
12
|
+
--_active-indicator-width: var(--ui-circular-progress-active-indicator-width, 10);
|
|
13
|
+
--_four-color-active-indicator-four-color: var(
|
|
14
|
+
--ui-circular-progress-four-color-active-indicator-four-color,
|
|
15
|
+
var(--md-sys-color-tertiary-container)
|
|
16
|
+
);
|
|
17
|
+
--_four-color-active-indicator-one-color: var(
|
|
18
|
+
--ui-circular-progress-four-color-active-indicator-one-color,
|
|
19
|
+
var(--md-sys-color-primary)
|
|
20
|
+
);
|
|
21
|
+
--_four-color-active-indicator-three-color: var(
|
|
22
|
+
--ui-circular-progress-four-color-active-indicator-three-color,
|
|
23
|
+
var(--md-sys-color-tertiary)
|
|
24
|
+
);
|
|
25
|
+
--_four-color-active-indicator-two-color: var(
|
|
26
|
+
--ui-circular-progress-four-color-active-indicator-two-color,
|
|
27
|
+
var(--md-sys-color-primary-container)
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
vertical-align: middle;
|
|
32
|
+
width: var(--_size);
|
|
33
|
+
height: var(--_size);
|
|
34
|
+
position: relative;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
|
|
38
|
+
contain: strict;
|
|
39
|
+
content-visibility: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.progress,
|
|
43
|
+
.spinner,
|
|
44
|
+
.left,
|
|
45
|
+
.right,
|
|
46
|
+
.circle,
|
|
47
|
+
svg,
|
|
48
|
+
.track,
|
|
49
|
+
.active-track {
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
svg {
|
|
55
|
+
transform: rotate(-90deg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
circle {
|
|
59
|
+
cx: 50%;
|
|
60
|
+
cy: 50%;
|
|
61
|
+
r: calc(50% * (1 - var(--_active-indicator-width) / 100));
|
|
62
|
+
stroke-width: calc(var(--_active-indicator-width) * 1%);
|
|
63
|
+
stroke-dasharray: 100;
|
|
64
|
+
fill: transparent;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.active-track {
|
|
68
|
+
transition: stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);
|
|
69
|
+
stroke: var(--_active-indicator-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.track {
|
|
73
|
+
stroke: transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([indeterminate]) {
|
|
77
|
+
animation: linear infinite linear-rotate;
|
|
78
|
+
animation-duration: var(--ui-circular-progress-linear-rotate-duration);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.spinner {
|
|
82
|
+
animation: infinite both rotate-arc;
|
|
83
|
+
animation-duration: var(--ui-circular-progress-cycle-duration);
|
|
84
|
+
animation-timing-function: var(--ui-circular-progress-indeterminate-easing);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.left {
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
inset: 0 50% 0 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.right {
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
inset: 0 0 0 50%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.circle {
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
--_padding-box-width: calc(var(--_size) - 2 * var(--_container-padding));
|
|
101
|
+
--_active-indicator-fraction: calc(var(--_active-indicator-width) / 100);
|
|
102
|
+
border: solid calc(var(--_active-indicator-fraction) * var(--_padding-box-width));
|
|
103
|
+
border-color: var(--_active-indicator-color) var(--_active-indicator-color) transparent transparent;
|
|
104
|
+
animation: expand-arc;
|
|
105
|
+
animation-iteration-count: infinite;
|
|
106
|
+
animation-fill-mode: both;
|
|
107
|
+
animation-duration: var(--ui-circular-progress-arc-duration), var(--ui-circular-progress-cycle-duration);
|
|
108
|
+
animation-timing-function: var(--ui-circular-progress-indeterminate-easing);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.left .circle {
|
|
112
|
+
rotate: 135deg;
|
|
113
|
+
inset: 0 -100% 0 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.right .circle {
|
|
117
|
+
rotate: 100deg;
|
|
118
|
+
inset: 0 0 0 -100%;
|
|
119
|
+
animation-delay: calc(-0.5 * var(--ui-circular-progress-arc-duration)), 0ms;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([fourcolor]) .circle {
|
|
123
|
+
animation-name: expand-arc, four-color;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@keyframes expand-arc {
|
|
127
|
+
0% {
|
|
128
|
+
transform: rotate(265deg);
|
|
129
|
+
}
|
|
130
|
+
50% {
|
|
131
|
+
transform: rotate(130deg);
|
|
132
|
+
}
|
|
133
|
+
100% {
|
|
134
|
+
transform: rotate(265deg);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@keyframes rotate-arc {
|
|
139
|
+
12.5% {
|
|
140
|
+
transform: rotate(135deg);
|
|
141
|
+
}
|
|
142
|
+
25% {
|
|
143
|
+
transform: rotate(270deg);
|
|
144
|
+
}
|
|
145
|
+
37.5% {
|
|
146
|
+
transform: rotate(405deg);
|
|
147
|
+
}
|
|
148
|
+
50% {
|
|
149
|
+
transform: rotate(540deg);
|
|
150
|
+
}
|
|
151
|
+
62.5% {
|
|
152
|
+
transform: rotate(675deg);
|
|
153
|
+
}
|
|
154
|
+
75% {
|
|
155
|
+
transform: rotate(810deg);
|
|
156
|
+
}
|
|
157
|
+
87.5% {
|
|
158
|
+
transform: rotate(945deg);
|
|
159
|
+
}
|
|
160
|
+
100% {
|
|
161
|
+
transform: rotate(1080deg);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@keyframes linear-rotate {
|
|
166
|
+
to {
|
|
167
|
+
transform: rotate(360deg);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@keyframes four-color {
|
|
172
|
+
0% {
|
|
173
|
+
border-top-color: var(--_four-color-active-indicator-one-color);
|
|
174
|
+
border-right-color: var(--_four-color-active-indicator-one-color);
|
|
175
|
+
}
|
|
176
|
+
15% {
|
|
177
|
+
border-top-color: var(--_four-color-active-indicator-one-color);
|
|
178
|
+
border-right-color: var(--_four-color-active-indicator-one-color);
|
|
179
|
+
}
|
|
180
|
+
25% {
|
|
181
|
+
border-top-color: var(--_four-color-active-indicator-two-color);
|
|
182
|
+
border-right-color: var(--_four-color-active-indicator-two-color);
|
|
183
|
+
}
|
|
184
|
+
40% {
|
|
185
|
+
border-top-color: var(--_four-color-active-indicator-two-color);
|
|
186
|
+
border-right-color: var(--_four-color-active-indicator-two-color);
|
|
187
|
+
}
|
|
188
|
+
50% {
|
|
189
|
+
border-top-color: var(--_four-color-active-indicator-three-color);
|
|
190
|
+
border-right-color: var(--_four-color-active-indicator-three-color);
|
|
191
|
+
}
|
|
192
|
+
65% {
|
|
193
|
+
border-top-color: var(--_four-color-active-indicator-three-color);
|
|
194
|
+
border-right-color: var(--_four-color-active-indicator-three-color);
|
|
195
|
+
}
|
|
196
|
+
75% {
|
|
197
|
+
border-top-color: var(--_four-color-active-indicator-four-color);
|
|
198
|
+
border-right-color: var(--_four-color-active-indicator-four-color);
|
|
199
|
+
}
|
|
200
|
+
90% {
|
|
201
|
+
border-top-color: var(--_four-color-active-indicator-four-color);
|
|
202
|
+
border-right-color: var(--_four-color-active-indicator-four-color);
|
|
203
|
+
}
|
|
204
|
+
100% {
|
|
205
|
+
border-top-color: var(--_four-color-active-indicator-one-color);
|
|
206
|
+
border-right-color: var(--_four-color-active-indicator-one-color);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@media (forced-colors: active) {
|
|
211
|
+
.active-track {
|
|
212
|
+
stroke: CanvasText;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.circle {
|
|
216
|
+
border-color: CanvasText CanvasText Canvas Canvas;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
`;
|
|
220
|
+
//# sourceMappingURL=CircularProgress.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.styles.js","sourceRoot":"","sources":["../../../../../src/md/progress/internals/CircularProgress.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyNjB,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport default css`\n :host {\n --ui-circular-progress-arc-duration: 1333ms;\n --ui-circular-progress-cycle-duration: calc(4 * var(--ui-circular-progress-arc-duration));\n --ui-circular-progress-linear-rotate-duration: calc(var(--ui-circular-progress-arc-duration) * 360 / 306);\n --ui-circular-progress-indeterminate-easing: cubic-bezier(0.4, 0, 0.2, 1);\n --_container-padding: 4px;\n --_size: var(--ui-circular-progress-size, 48px);\n\n --_active-indicator-color: var(--ui-circular-progress-active-indicator-color, var(--md-sys-color-primary));\n --_active-indicator-width: var(--ui-circular-progress-active-indicator-width, 10);\n --_four-color-active-indicator-four-color: var(\n --ui-circular-progress-four-color-active-indicator-four-color,\n var(--md-sys-color-tertiary-container)\n );\n --_four-color-active-indicator-one-color: var(\n --ui-circular-progress-four-color-active-indicator-one-color,\n var(--md-sys-color-primary)\n );\n --_four-color-active-indicator-three-color: var(\n --ui-circular-progress-four-color-active-indicator-three-color,\n var(--md-sys-color-tertiary)\n );\n --_four-color-active-indicator-two-color: var(\n --ui-circular-progress-four-color-active-indicator-two-color,\n var(--md-sys-color-primary-container)\n );\n\n display: inline-flex;\n vertical-align: middle;\n width: var(--_size);\n height: var(--_size);\n position: relative;\n align-items: center;\n justify-content: center;\n\n contain: strict;\n content-visibility: auto;\n }\n\n .progress,\n .spinner,\n .left,\n .right,\n .circle,\n svg,\n .track,\n .active-track {\n position: absolute;\n inset: 0;\n }\n\n svg {\n transform: rotate(-90deg);\n }\n\n circle {\n cx: 50%;\n cy: 50%;\n r: calc(50% * (1 - var(--_active-indicator-width) / 100));\n stroke-width: calc(var(--_active-indicator-width) * 1%);\n stroke-dasharray: 100;\n fill: transparent;\n }\n\n .active-track {\n transition: stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);\n stroke: var(--_active-indicator-color);\n }\n\n .track {\n stroke: transparent;\n }\n\n :host([indeterminate]) {\n animation: linear infinite linear-rotate;\n animation-duration: var(--ui-circular-progress-linear-rotate-duration);\n }\n\n .spinner {\n animation: infinite both rotate-arc;\n animation-duration: var(--ui-circular-progress-cycle-duration);\n animation-timing-function: var(--ui-circular-progress-indeterminate-easing);\n }\n\n .left {\n overflow: hidden;\n inset: 0 50% 0 0;\n }\n\n .right {\n overflow: hidden;\n inset: 0 0 0 50%;\n }\n\n .circle {\n box-sizing: border-box;\n border-radius: 50%;\n --_padding-box-width: calc(var(--_size) - 2 * var(--_container-padding));\n --_active-indicator-fraction: calc(var(--_active-indicator-width) / 100);\n border: solid calc(var(--_active-indicator-fraction) * var(--_padding-box-width));\n border-color: var(--_active-indicator-color) var(--_active-indicator-color) transparent transparent;\n animation: expand-arc;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n animation-duration: var(--ui-circular-progress-arc-duration), var(--ui-circular-progress-cycle-duration);\n animation-timing-function: var(--ui-circular-progress-indeterminate-easing);\n }\n\n .left .circle {\n rotate: 135deg;\n inset: 0 -100% 0 0;\n }\n\n .right .circle {\n rotate: 100deg;\n inset: 0 0 0 -100%;\n animation-delay: calc(-0.5 * var(--ui-circular-progress-arc-duration)), 0ms;\n }\n\n :host([fourcolor]) .circle {\n animation-name: expand-arc, four-color;\n }\n\n @keyframes expand-arc {\n 0% {\n transform: rotate(265deg);\n }\n 50% {\n transform: rotate(130deg);\n }\n 100% {\n transform: rotate(265deg);\n }\n }\n\n @keyframes rotate-arc {\n 12.5% {\n transform: rotate(135deg);\n }\n 25% {\n transform: rotate(270deg);\n }\n 37.5% {\n transform: rotate(405deg);\n }\n 50% {\n transform: rotate(540deg);\n }\n 62.5% {\n transform: rotate(675deg);\n }\n 75% {\n transform: rotate(810deg);\n }\n 87.5% {\n transform: rotate(945deg);\n }\n 100% {\n transform: rotate(1080deg);\n }\n }\n\n @keyframes linear-rotate {\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes four-color {\n 0% {\n border-top-color: var(--_four-color-active-indicator-one-color);\n border-right-color: var(--_four-color-active-indicator-one-color);\n }\n 15% {\n border-top-color: var(--_four-color-active-indicator-one-color);\n border-right-color: var(--_four-color-active-indicator-one-color);\n }\n 25% {\n border-top-color: var(--_four-color-active-indicator-two-color);\n border-right-color: var(--_four-color-active-indicator-two-color);\n }\n 40% {\n border-top-color: var(--_four-color-active-indicator-two-color);\n border-right-color: var(--_four-color-active-indicator-two-color);\n }\n 50% {\n border-top-color: var(--_four-color-active-indicator-three-color);\n border-right-color: var(--_four-color-active-indicator-three-color);\n }\n 65% {\n border-top-color: var(--_four-color-active-indicator-three-color);\n border-right-color: var(--_four-color-active-indicator-three-color);\n }\n 75% {\n border-top-color: var(--_four-color-active-indicator-four-color);\n border-right-color: var(--_four-color-active-indicator-four-color);\n }\n 90% {\n border-top-color: var(--_four-color-active-indicator-four-color);\n border-right-color: var(--_four-color-active-indicator-four-color);\n }\n 100% {\n border-top-color: var(--_four-color-active-indicator-one-color);\n border-right-color: var(--_four-color-active-indicator-one-color);\n }\n }\n\n @media (forced-colors: active) {\n .active-track {\n stroke: CanvasText;\n }\n\n .circle {\n border-color: CanvasText CanvasText Canvas Canvas;\n }\n }\n`\n"]}
|
|
@@ -31,6 +31,12 @@ export declare abstract class UiRange extends UiElement {
|
|
|
31
31
|
* @attribute
|
|
32
32
|
*/
|
|
33
33
|
accessor step: number;
|
|
34
|
+
/**
|
|
35
|
+
* Use an indeterminate progress indicator.
|
|
36
|
+
* @attribute
|
|
37
|
+
*/
|
|
38
|
+
accessor indeterminate: boolean | undefined;
|
|
39
|
+
connectedCallback(): void;
|
|
34
40
|
protected willUpdate(cp: PropertyValues<this>): void;
|
|
35
41
|
protected rangeChanged(): void;
|
|
36
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../../../../src/md/progress/internals/Range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAGpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C;;GAEG;AACH,8BAAsB,OAAQ,SAAQ,SAAS;IAC7C,SAAS,CAAC,aAAa,SAAI;IAE3B,SAAS,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEnC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAE3B;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;OAGG;IACoD,QAAQ,CAAC,KAAK,SAAI;IAEzE;;;OAGG;IACoD,QAAQ,CAAC,GAAG,SAAI;IAEvE;;;OAGG;IACoD,QAAQ,CAAC,GAAG,SAAM;IAEzE;;;OAGG;IACoD,QAAQ,CAAC,IAAI,SAAI;
|
|
1
|
+
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../../../../src/md/progress/internals/Range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAGpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C;;GAEG;AACH,8BAAsB,OAAQ,SAAQ,SAAS;IAC7C,SAAS,CAAC,aAAa,SAAI;IAE3B,SAAS,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEnC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAE3B;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;OAGG;IACoD,QAAQ,CAAC,KAAK,SAAI;IAEzE;;;OAGG;IACoD,QAAQ,CAAC,GAAG,SAAI;IAEvE;;;OAGG;IACoD,QAAQ,CAAC,GAAG,SAAM;IAEzE;;;OAGG;IACoD,QAAQ,CAAC,IAAI,SAAI;IAExE;;;OAGG;IACyC,QAAQ,CAAC,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAE9E,iBAAiB,IAAI,IAAI;cAOf,UAAU,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAqB7D,SAAS,CAAC,YAAY,IAAI,IAAI;IAS9B;;;OAGG;IACH,SAAS,CAAC,aAAa,IAAI,OAAO;IAOlC,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI3C,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAoB3C,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAO9C"}
|
|
@@ -19,6 +19,9 @@ let UiRange = (() => {
|
|
|
19
19
|
let _step_decorators;
|
|
20
20
|
let _step_initializers = [];
|
|
21
21
|
let _step_extraInitializers = [];
|
|
22
|
+
let _indeterminate_decorators;
|
|
23
|
+
let _indeterminate_initializers = [];
|
|
24
|
+
let _indeterminate_extraInitializers = [];
|
|
22
25
|
return class UiRange extends _classSuper {
|
|
23
26
|
static {
|
|
24
27
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -26,10 +29,12 @@ let UiRange = (() => {
|
|
|
26
29
|
_min_decorators = [property({ type: Number, converter: floatConverter })];
|
|
27
30
|
_max_decorators = [property({ type: Number, converter: floatConverter })];
|
|
28
31
|
_step_decorators = [property({ type: Number, converter: floatConverter })];
|
|
32
|
+
_indeterminate_decorators = [property({ reflect: true, type: Boolean })];
|
|
29
33
|
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
30
34
|
__esDecorate(this, null, _min_decorators, { kind: "accessor", name: "min", static: false, private: false, access: { has: obj => "min" in obj, get: obj => obj.min, set: (obj, value) => { obj.min = value; } }, metadata: _metadata }, _min_initializers, _min_extraInitializers);
|
|
31
35
|
__esDecorate(this, null, _max_decorators, { kind: "accessor", name: "max", static: false, private: false, access: { has: obj => "max" in obj, get: obj => obj.max, set: (obj, value) => { obj.max = value; } }, metadata: _metadata }, _max_initializers, _max_extraInitializers);
|
|
32
36
|
__esDecorate(this, null, _step_decorators, { kind: "accessor", name: "step", static: false, private: false, access: { has: obj => "step" in obj, get: obj => obj.step, set: (obj, value) => { obj.step = value; } }, metadata: _metadata }, _step_initializers, _step_extraInitializers);
|
|
37
|
+
__esDecorate(this, null, _indeterminate_decorators, { kind: "accessor", name: "indeterminate", static: false, private: false, access: { has: obj => "indeterminate" in obj, get: obj => obj.indeterminate, set: (obj, value) => { obj.indeterminate = value; } }, metadata: _metadata }, _indeterminate_initializers, _indeterminate_extraInitializers);
|
|
33
38
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
34
39
|
}
|
|
35
40
|
ratioInternal = 0;
|
|
@@ -77,17 +82,50 @@ let UiRange = (() => {
|
|
|
77
82
|
*/
|
|
78
83
|
get max() { return this.#max_accessor_storage; }
|
|
79
84
|
set max(value) { this.#max_accessor_storage = value; }
|
|
80
|
-
#step_accessor_storage = (__runInitializers(this, _max_extraInitializers), __runInitializers(this, _step_initializers, 1
|
|
85
|
+
#step_accessor_storage = (__runInitializers(this, _max_extraInitializers), __runInitializers(this, _step_initializers, 1
|
|
86
|
+
/**
|
|
87
|
+
* Use an indeterminate progress indicator.
|
|
88
|
+
* @attribute
|
|
89
|
+
*/
|
|
90
|
+
));
|
|
81
91
|
/**
|
|
82
92
|
* Specifies the value granularity of the range's value.
|
|
83
93
|
* @attribute
|
|
84
94
|
*/
|
|
85
95
|
get step() { return this.#step_accessor_storage; }
|
|
86
96
|
set step(value) { this.#step_accessor_storage = value; }
|
|
97
|
+
#indeterminate_accessor_storage = (__runInitializers(this, _step_extraInitializers), __runInitializers(this, _indeterminate_initializers, void 0));
|
|
98
|
+
/**
|
|
99
|
+
* Use an indeterminate progress indicator.
|
|
100
|
+
* @attribute
|
|
101
|
+
*/
|
|
102
|
+
get indeterminate() { return this.#indeterminate_accessor_storage; }
|
|
103
|
+
set indeterminate(value) { this.#indeterminate_accessor_storage = value; }
|
|
104
|
+
connectedCallback() {
|
|
105
|
+
super.connectedCallback();
|
|
106
|
+
if (!this.hasAttribute('role')) {
|
|
107
|
+
this.setAttribute('role', 'progressbar');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
87
110
|
willUpdate(cp) {
|
|
88
|
-
if (cp.has('value') || cp.has('min') || cp.has('max') || cp.has('step')) {
|
|
111
|
+
if (cp.has('value') || cp.has('min') || cp.has('max') || cp.has('step') || cp.has('indeterminate')) {
|
|
89
112
|
this.rangeChanged();
|
|
90
113
|
}
|
|
114
|
+
if (cp.has('min')) {
|
|
115
|
+
this.setAttribute('aria-valuemin', String(this.min));
|
|
116
|
+
}
|
|
117
|
+
if (cp.has('max')) {
|
|
118
|
+
this.setAttribute('aria-valuemax', String(this.max));
|
|
119
|
+
}
|
|
120
|
+
if (cp.has('indeterminate') || cp.has('value')) {
|
|
121
|
+
if (this.indeterminate) {
|
|
122
|
+
this.removeAttribute('aria-valuenow');
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.setAttribute('aria-valuenow', String(this.value));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
super.willUpdate(cp);
|
|
91
129
|
}
|
|
92
130
|
rangeChanged() {
|
|
93
131
|
this.validateValue();
|
|
@@ -138,7 +176,7 @@ let UiRange = (() => {
|
|
|
138
176
|
}
|
|
139
177
|
constructor() {
|
|
140
178
|
super(...arguments);
|
|
141
|
-
__runInitializers(this,
|
|
179
|
+
__runInitializers(this, _indeterminate_extraInitializers);
|
|
142
180
|
}
|
|
143
181
|
};
|
|
144
182
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.js","sourceRoot":"","sources":["../../../../../src/md/progress/internals/Range.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C;;GAEG;IACmB,OAAO;sBAAS,SAAS
|
|
1
|
+
{"version":3,"file":"Range.js","sourceRoot":"","sources":["../../../../../src/md/progress/internals/Range.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C;;GAEG;IACmB,OAAO;sBAAS,SAAS;;;;;;;;;;;;;;;;iBAAzB,OAAQ,SAAQ,WAAS;;;iCAkB5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;+BAMrD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;+BAMrD,QAAQ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,CAAC;YACD,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAA;QACxC,CAAC;QAES,YAAY,CAAC,KAAa;YAClC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;YACvC,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;gBACtB,OAAO,CAAC,CAAA;YACV,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACpE,CAAC;;;;;;;SA1HmB,OAAO","sourcesContent":["import { PropertyValues } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { floatConverter } from '../../../lib/AttributeConverters.js'\nimport { UiElement } from '../../UiElement.js'\n\n/**\n * @fires ratiochange - When `ratio` computation is ready.\n */\nexport abstract class UiRange extends UiElement {\n protected ratioInternal = 0\n\n protected debounceInternal?: number\n\n protected oldValue?: number\n\n /**\n * @returns the ratio of the value.\n */\n get ratio(): number {\n return this.ratioInternal\n }\n\n /**\n * The number that represents the current value.\n * @attribute\n */\n @property({ type: Number, converter: floatConverter }) accessor value = 0\n\n /**\n * The number that indicates the minimum value of the range.\n * @attribute\n */\n @property({ type: Number, converter: floatConverter }) accessor min = 0\n\n /**\n * The number that indicates the maximum value of the range.\n * @attribute\n */\n @property({ type: Number, converter: floatConverter }) accessor max = 100\n\n /**\n * Specifies the value granularity of the range's value.\n * @attribute\n */\n @property({ type: Number, converter: floatConverter }) accessor step = 1\n\n /**\n * Use an indeterminate progress indicator.\n * @attribute\n */\n @property({ reflect: true, type: Boolean }) accessor indeterminate: boolean | undefined\n\n override connectedCallback(): void {\n super.connectedCallback()\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'progressbar')\n }\n }\n\n protected override willUpdate(cp: PropertyValues<this>): void {\n if (cp.has('value') || cp.has('min') || cp.has('max') || cp.has('step') || cp.has('indeterminate')) {\n this.rangeChanged()\n }\n\n if (cp.has('min')) {\n this.setAttribute('aria-valuemin', String(this.min))\n }\n if (cp.has('max')) {\n this.setAttribute('aria-valuemax', String(this.max))\n }\n if (cp.has('indeterminate') || cp.has('value')) {\n if (this.indeterminate) {\n this.removeAttribute('aria-valuenow')\n } else {\n this.setAttribute('aria-valuenow', String(this.value))\n }\n }\n super.willUpdate(cp)\n }\n\n protected rangeChanged(): void {\n this.validateValue()\n const ratio = this.computeRatio(this.value) * 100\n if (this.ratioInternal !== ratio) {\n this.ratioInternal = ratio\n this.dispatchEvent(new Event('ratiochange'))\n }\n }\n\n /**\n * Makes sure the value is in the right format.\n * @returns True when the value has changed.\n */\n protected validateValue(): boolean {\n const v = this.clampValue(this.value)\n this.oldValue = Number.isNaN(v) ? this.oldValue : v\n this.value = this.oldValue || 0\n return this.value !== v\n }\n\n protected clampValue(value: number): number {\n return Math.min(this.max, Math.max(this.min, this.computeStep(value)))\n }\n\n protected computeStep(step: number): number {\n const value = step\n if (!this.step) {\n return value\n }\n const numSteps = Math.round((value - this.min) / this.step)\n if (this.step < 1) {\n /**\n * For small values of this.step, if we calculate the step using\n * `Math.round(value / step) * step` we may hit a precision point issue\n * eg. 0.1 * 0.2 = 0.020000000000000004\n * http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html\n *\n * as a work around we can divide by the reciprocal of `step`\n */\n return numSteps / (1 / this.step) + this.min\n }\n return numSteps * this.step + this.min\n }\n\n protected computeRatio(value: number): number {\n const denominator = this.max - this.min\n if (denominator === 0) {\n return 0\n }\n return (this.clampValue(value) - this.min) / (this.max - this.min)\n }\n}\n"]}
|
|
@@ -13,18 +13,11 @@ export default class UiProgress extends UiRange {
|
|
|
13
13
|
* @attr
|
|
14
14
|
*/
|
|
15
15
|
accessor secondaryProgress: number | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Use an indeterminate progress indicator.
|
|
18
|
-
* @attr
|
|
19
|
-
*/
|
|
20
|
-
accessor indeterminate: boolean | undefined;
|
|
21
16
|
/**
|
|
22
17
|
* @returns The ratio of the secondary progress.
|
|
23
18
|
*/
|
|
24
19
|
get secondaryRatio(): number;
|
|
25
|
-
connectedCallback(): void;
|
|
26
20
|
protected willUpdate(cp: PropertyValues<this>): void;
|
|
27
|
-
protected updated(cp: PropertyValues<this>): void;
|
|
28
21
|
protected rangeChanged(): void;
|
|
29
22
|
render(): TemplateResult;
|
|
30
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiProgress.d.ts","sourceRoot":"","sources":["../../../../../src/md/progress/internals/UiProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAI1D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAIpC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,SAAS,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAEzC,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,IACI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAI1B;IAED;;;OAGG;IACoD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IAErG
|
|
1
|
+
{"version":3,"file":"UiProgress.d.ts","sourceRoot":"","sources":["../../../../../src/md/progress/internals/UiProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAI1D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAIpC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,SAAS,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAEzC,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,IACI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAI1B;IAED;;;OAGG;IACoD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IAErG;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;cAEkB,UAAU,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAO1C,YAAY,IAAI,IAAI;IAW9B,MAAM,IAAI,cAAc;CAyBlC"}
|