@frontile/status 0.18.0-alpha.1 → 0.18.0-alpha.11
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/declarations/index.d.ts +1 -1
- package/declarations/template-registry.d.ts +1 -4
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -7
- package/dist/_app_/components/progress-bar.js +0 -1
- package/dist/components/progress-bar.js +0 -85
- package/dist/components/progress-bar.js.map +0 -1
package/declarations/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from 'frontile/status';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { deprecate } from '@ember/debug';
|
|
2
|
+
export * from 'frontile/status';
|
|
3
|
+
|
|
4
|
+
deprecate('Importing from "@frontile/status" is deprecated. ' + 'Import from "frontile" or "frontile/status" instead. ' + 'See https://frontile.dev/docs/migrations/v0.18/package-consolidation', false, {
|
|
5
|
+
id: 'frontile.import-from-status',
|
|
6
|
+
until: '0.19.0',
|
|
7
|
+
for: 'frontile',
|
|
8
|
+
since: {
|
|
9
|
+
available: '0.18.0',
|
|
10
|
+
enabled: '0.18.0'
|
|
11
|
+
},
|
|
12
|
+
url: 'https://frontile.dev/docs/migrations/v0.18/package-consolidation'
|
|
13
|
+
});
|
|
2
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\ndeprecate(\n 'Importing from \"@frontile/status\" is deprecated. ' +\n 'Import from \"frontile\" or \"frontile/status\" instead. ' +\n 'See https://frontile.dev/docs/migrations/v0.18/package-consolidation',\n false,\n {\n id: 'frontile.import-from-status',\n until: '0.19.0',\n for: 'frontile',\n since: { available: '0.18.0', enabled: '0.18.0' },\n url: 'https://frontile.dev/docs/migrations/v0.18/package-consolidation'\n }\n);\n\nexport * from 'frontile/status';\n"],"names":["deprecate","id","until","for","since","available","enabled","url"],"mappings":";;;AAEAA,SAAS,CACP,mDAAmD,GACjD,uDAAuD,GACvD,sEAAsE,EACxE,KAAK,EACL;AACEC,EAAAA,EAAE,EAAE,6BAA6B;AACjCC,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,GAAG,EAAE,UAAU;AACfC,EAAAA,KAAK,EAAE;AAAEC,IAAAA,SAAS,EAAE,QAAQ;AAAEC,IAAAA,OAAO,EAAE;GAAU;AACjDC,EAAAA,GAAG,EAAE;AACP,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontile/status",
|
|
3
|
-
"version": "0.18.0-alpha.
|
|
3
|
+
"version": "0.18.0-alpha.11",
|
|
4
4
|
"description": "Component Library for Ember Octane apps: Status",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@embroider/addon-shim": "^1.9.0",
|
|
56
|
-
"
|
|
56
|
+
"frontile": "^0.18.0-alpha.11"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/core": "7.26.7",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@glint/core": "1.5.2",
|
|
65
65
|
"@glint/environment-ember-loose": "1.5.2",
|
|
66
66
|
"@glint/environment-ember-template-imports": "1.5.2",
|
|
67
|
-
"@glint/template": "1.
|
|
67
|
+
"@glint/template": "^1.7.4",
|
|
68
68
|
"@rollup/plugin-babel": "^6.0.4",
|
|
69
69
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
70
70
|
"@tsconfig/ember": "^3.0.9",
|
|
@@ -94,9 +94,7 @@
|
|
|
94
94
|
"version": 2,
|
|
95
95
|
"type": "addon",
|
|
96
96
|
"main": "addon-main.js",
|
|
97
|
-
"app-js": {
|
|
98
|
-
"./components/progress-bar.js": "./dist/_app_/components/progress-bar.js"
|
|
99
|
-
}
|
|
97
|
+
"app-js": {}
|
|
100
98
|
},
|
|
101
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "740a78a92f68c5bd48e1d793ca1ad1d24f2de77a"
|
|
102
100
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "@frontile/status/components/progress-bar";
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { useStyles } from '@frontile/theme';
|
|
3
|
-
import { htmlSafe } from '@ember/template';
|
|
4
|
-
import { guidFor } from '@ember/object/internals';
|
|
5
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
-
import { setComponentTemplate } from '@ember/component';
|
|
7
|
-
|
|
8
|
-
class ProgressBar extends Component {
|
|
9
|
-
id = guidFor(this);
|
|
10
|
-
get classNames() {
|
|
11
|
-
const {
|
|
12
|
-
progressBar
|
|
13
|
-
} = useStyles();
|
|
14
|
-
const {
|
|
15
|
-
base,
|
|
16
|
-
progress,
|
|
17
|
-
label,
|
|
18
|
-
description
|
|
19
|
-
} = progressBar({
|
|
20
|
-
intent: this.args.intent || 'default',
|
|
21
|
-
size: this.args.size,
|
|
22
|
-
radius: this.args.radius,
|
|
23
|
-
isIndeterminate: this.args.isIndeterminate
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
base: base({
|
|
27
|
-
class: this.args.class
|
|
28
|
-
}),
|
|
29
|
-
progress: progress(),
|
|
30
|
-
label: label(),
|
|
31
|
-
description: description()
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
get minValue() {
|
|
35
|
-
return this.args.minValue || 0;
|
|
36
|
-
}
|
|
37
|
-
get maxValue() {
|
|
38
|
-
return this.args.maxValue || 100;
|
|
39
|
-
}
|
|
40
|
-
get progress() {
|
|
41
|
-
return this.args.progress || this.minValue;
|
|
42
|
-
}
|
|
43
|
-
get percentage() {
|
|
44
|
-
return (this.progress - this.minValue) / (this.maxValue - this.minValue) * 100;
|
|
45
|
-
}
|
|
46
|
-
get showValueLabel() {
|
|
47
|
-
if (typeof this.args.showValueLabel !== 'undefined') {
|
|
48
|
-
return this.args.showValueLabel;
|
|
49
|
-
}
|
|
50
|
-
return !!this.args.label;
|
|
51
|
-
}
|
|
52
|
-
get formattedValueLabel() {
|
|
53
|
-
// check if the value label should not be shown
|
|
54
|
-
if (!this.showValueLabel || this.args.isIndeterminate) {
|
|
55
|
-
return '';
|
|
56
|
-
}
|
|
57
|
-
// if @labelValue is provided use it
|
|
58
|
-
if (this.args.valueLabel) {
|
|
59
|
-
return this.args.valueLabel;
|
|
60
|
-
}
|
|
61
|
-
// if format options are provided
|
|
62
|
-
if (this.args.formatOptions) {
|
|
63
|
-
const options = {
|
|
64
|
-
...(this.args.formatOptions || {})
|
|
65
|
-
};
|
|
66
|
-
return new Intl.NumberFormat(navigator?.language || 'en-US', options).format(this.progress);
|
|
67
|
-
}
|
|
68
|
-
return this.percentage.toFixed(0) + '%';
|
|
69
|
-
}
|
|
70
|
-
get progressWidth() {
|
|
71
|
-
let percentage = this.percentage;
|
|
72
|
-
if (this.args.isIndeterminate) {
|
|
73
|
-
percentage = 50;
|
|
74
|
-
}
|
|
75
|
-
return htmlSafe(`width: ${percentage}%`);
|
|
76
|
-
}
|
|
77
|
-
static {
|
|
78
|
-
setComponentTemplate(precompileTemplate("\n <div ...attributes>\n {{#if @label}}\n <div class={{this.classNames.label}}>\n <label id={{this.id}}>\n {{@label}}\n </label>\n {{#if this.showValueLabel}}\n <div>\n {{this.formattedValueLabel}}\n </div>\n {{/if}}\n </div>\n {{/if}}\n {{#if @description}}\n <div class={{this.classNames.description}}>\n {{@description}}\n </div>\n {{/if}}\n <div class={{this.classNames.base}}>\n <div role=\"progressbar\" aria-labelledby={{if @label this.id}} aria-valuenow={{this.progress}} aria-valuemin={{this.minValue}} aria-valuemax={{this.maxValue}} class={{this.classNames.progress}} style={{this.progressWidth}}></div>\n </div>\n </div>\n ", {
|
|
79
|
-
strictMode: true
|
|
80
|
-
}), this);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { ProgressBar, ProgressBar as default };
|
|
85
|
-
//# sourceMappingURL=progress-bar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.js","sources":["../../src/components/progress-bar.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { htmlSafe } from '@ember/template';\nimport type { SafeString } from '@ember/template';\nimport { guidFor } from '@ember/object/internals';\n\ninterface ProgressBarSignature {\n Args: {\n /**\n * The intent of the progress bar\n */\n intent?: 'default' | 'primary' | 'success' | 'warning' | 'danger';\n\n /**\n * The size of the progress bar\n */\n size?: 'xs' | 'sm' | 'md' | 'lg';\n\n /**\n * The radius the progress bar\n */\n radius?: 'none' | 'sm' | 'lg' | 'full';\n\n /**\n * The current progress value\n */\n progress?: number;\n\n /**\n *\n * The smallest value allowed for the input\n *\n * @defaultValue 0\n */\n minValue?: number;\n\n /**\n *\n * The largest value allowed for the input\n *\n *@defaultValue 100\n */\n maxValue?: number;\n\n /**\n * Whether presentation is indeterminate when progress isn't known.\n *\n * @defaultValue false\n */\n isIndeterminate?: boolean;\n\n /**\n * The content to display as the label.\n */\n label?: string;\n\n /**\n * The content to display as the value's label (e.g. 1 of 4).\n */\n valueLabel?: string;\n\n /**\n * Whether the value's label is displayed.\n * True by default if there's a label, false by default if not.\n */\n showValueLabel?: boolean;\n\n /**\n * The display format of the value.\n * Values are formatted as a percentage by default.\n */\n formatOptions?: Intl.NumberFormatOptions;\n\n /**\n * The content to display as the description.\n */\n description?: string;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nclass ProgressBar extends Component<ProgressBarSignature> {\n id = guidFor(this);\n\n get classNames() {\n const { progressBar } = useStyles();\n\n const { base, progress, label, description } = progressBar({\n intent: this.args.intent || 'default',\n size: this.args.size,\n radius: this.args.radius,\n isIndeterminate: this.args.isIndeterminate\n });\n\n return {\n base: base({ class: this.args.class }),\n progress: progress(),\n label: label(),\n description: description()\n };\n }\n\n get minValue(): number {\n return this.args.minValue || 0;\n }\n\n get maxValue(): number {\n return this.args.maxValue || 100;\n }\n\n get progress(): number {\n return this.args.progress || this.minValue;\n }\n\n get percentage(): number {\n return (\n ((this.progress - this.minValue) / (this.maxValue - this.minValue)) * 100\n );\n }\n\n get showValueLabel(): boolean {\n if (typeof this.args.showValueLabel !== 'undefined') {\n return this.args.showValueLabel;\n }\n\n return !!this.args.label;\n }\n\n get formattedValueLabel(): string {\n // check if the value label should not be shown\n if (!this.showValueLabel || this.args.isIndeterminate) {\n return '';\n }\n\n // if @labelValue is provided use it\n if (this.args.valueLabel) {\n return this.args.valueLabel;\n }\n\n // if format options are provided\n if (this.args.formatOptions) {\n const options: Intl.NumberFormatOptions = {\n ...(this.args.formatOptions || {})\n };\n\n return new Intl.NumberFormat(\n navigator?.language || 'en-US',\n options\n ).format(this.progress);\n }\n\n return this.percentage.toFixed(0) + '%';\n }\n\n get progressWidth(): SafeString {\n let percentage = this.percentage;\n if (this.args.isIndeterminate) {\n percentage = 50;\n }\n return htmlSafe(`width: ${percentage}%`);\n }\n\n <template>\n <div ...attributes>\n {{#if @label}}\n <div class={{this.classNames.label}}>\n <label id={{this.id}}>\n {{@label}}\n </label>\n {{#if this.showValueLabel}}\n <div>\n {{this.formattedValueLabel}}\n </div>\n {{/if}}\n </div>\n {{/if}}\n {{#if @description}}\n <div class={{this.classNames.description}}>\n {{@description}}\n </div>\n {{/if}}\n <div class={{this.classNames.base}}>\n <div\n role=\"progressbar\"\n aria-labelledby={{if @label this.id}}\n aria-valuenow={{this.progress}}\n aria-valuemin={{this.minValue}}\n aria-valuemax={{this.maxValue}}\n class={{this.classNames.progress}}\n style={{this.progressWidth}}\n ></div>\n </div>\n </div>\n </template>\n}\n\nexport { ProgressBar, type ProgressBarSignature };\nexport default ProgressBar;\n"],"names":["ProgressBar","Component","id","guidFor","classNames","progressBar","useStyles","base","progress","label","description","intent","args","size","radius","isIndeterminate","class","minValue","maxValue","percentage","showValueLabel","formattedValueLabel","valueLabel","formatOptions","options","Intl","NumberFormat","navigator","language","format","toFixed","progressWidth","htmlSafe","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;;AAyFA,MAAMA,oBAAoBC,SAAA,CAAU;AAClCC,EAAAA,EAAA,GAAKC,OAAA,CAAQ,IAAI,CAAA;EAEjB,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;IAExB,MAAM;MAAEC,IAAI;MAAEC,QAAQ;MAAEC,KAAK;AAAEC,MAAAA;KAAa,GAAGL,WAAA,CAAY;AACzDM,MAAAA,MAAA,EAAQ,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC5BE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,MAAA,EAAQ,IAAI,CAACF,IAAI,CAACE,MAAM;AACxBC,MAAAA,eAAA,EAAiB,IAAI,CAACH,IAAI,CAACG;AAC7B,KAAA,CAAA;IAEA,OAAO;MACLR,IAAA,EAAMA,IAAA,CAAK;AAAES,QAAAA,KAAA,EAAO,IAAI,CAACJ,IAAI,CAACI;AAAM,OAAA,CAAA;MACpCR,QAAA,EAAUA,QAAA,EAAA;MACVC,KAAA,EAAOA,KAAA,EAAA;MACPC,WAAA,EAAaA,WAAA;KACf;AACF,EAAA;EAEA,IAAIO,QAAAA,GAAmB;AACrB,IAAA,OAAO,IAAI,CAACL,IAAI,CAACK,QAAQ,IAAI,CAAA;AAC/B,EAAA;EAEA,IAAIC,QA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