@kubex/zinc 1.1.77 → 1.1.79
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/custom-elements.json +96 -2
- package/dist/vscode.html-custom-data.json +11 -1
- package/dist/web-types.json +28 -3
- package/dist/zn.d.ts +13 -0
- package/dist/zn.min.js +122 -100
- package/docs/pages/components/rating.md +61 -1
- package/package.json +1 -1
- package/src/components/rating/rating.component.ts +122 -56
- package/src/components/rating/rating.scss +30 -9
|
@@ -32072,12 +32072,32 @@
|
|
|
32072
32072
|
{
|
|
32073
32073
|
"description": "An example CSS custom property.",
|
|
32074
32074
|
"name": "--example"
|
|
32075
|
+
},
|
|
32076
|
+
{
|
|
32077
|
+
"description": "The color of the preview value.",
|
|
32078
|
+
"name": "--preview-color"
|
|
32079
|
+
},
|
|
32080
|
+
{
|
|
32081
|
+
"description": "The font size of the preview value.",
|
|
32082
|
+
"name": "--preview-size"
|
|
32075
32083
|
}
|
|
32076
32084
|
],
|
|
32077
32085
|
"cssParts": [
|
|
32086
|
+
{
|
|
32087
|
+
"description": "The form control that wraps the symbols and help text.",
|
|
32088
|
+
"name": "form-control"
|
|
32089
|
+
},
|
|
32090
|
+
{
|
|
32091
|
+
"description": "The help text's wrapper.",
|
|
32092
|
+
"name": "form-control-help-text"
|
|
32093
|
+
},
|
|
32078
32094
|
{
|
|
32079
32095
|
"description": "The component's base wrapper.",
|
|
32080
32096
|
"name": "base"
|
|
32097
|
+
},
|
|
32098
|
+
{
|
|
32099
|
+
"description": "The value shown next to the symbols when `preview` is enabled.",
|
|
32100
|
+
"name": "preview"
|
|
32081
32101
|
}
|
|
32082
32102
|
],
|
|
32083
32103
|
"slots": [
|
|
@@ -32088,6 +32108,10 @@
|
|
|
32088
32108
|
{
|
|
32089
32109
|
"description": "An example slot.",
|
|
32090
32110
|
"name": "example"
|
|
32111
|
+
},
|
|
32112
|
+
{
|
|
32113
|
+
"description": "Text that describes how to use the rating. Alternatively, you can use the `help-text` attribute.",
|
|
32114
|
+
"name": "help-text"
|
|
32091
32115
|
}
|
|
32092
32116
|
],
|
|
32093
32117
|
"members": [
|
|
@@ -32098,6 +32122,13 @@
|
|
|
32098
32122
|
"readonly": true,
|
|
32099
32123
|
"default": "new FormControlController(this, { assumeInteractionOn: ['zn-blur', 'zn-input'] })"
|
|
32100
32124
|
},
|
|
32125
|
+
{
|
|
32126
|
+
"kind": "field",
|
|
32127
|
+
"name": "hasSlotController",
|
|
32128
|
+
"privacy": "private",
|
|
32129
|
+
"readonly": true,
|
|
32130
|
+
"default": "new HasSlotController(this, 'help-text')"
|
|
32131
|
+
},
|
|
32101
32132
|
{
|
|
32102
32133
|
"kind": "field",
|
|
32103
32134
|
"name": "rating",
|
|
@@ -32105,6 +32136,13 @@
|
|
|
32105
32136
|
"text": "HTMLElement"
|
|
32106
32137
|
}
|
|
32107
32138
|
},
|
|
32139
|
+
{
|
|
32140
|
+
"kind": "field",
|
|
32141
|
+
"name": "symbols",
|
|
32142
|
+
"type": {
|
|
32143
|
+
"text": "HTMLElement"
|
|
32144
|
+
}
|
|
32145
|
+
},
|
|
32108
32146
|
{
|
|
32109
32147
|
"kind": "field",
|
|
32110
32148
|
"name": "hoverValue",
|
|
@@ -32131,6 +32169,16 @@
|
|
|
32131
32169
|
},
|
|
32132
32170
|
"attribute": "label"
|
|
32133
32171
|
},
|
|
32172
|
+
{
|
|
32173
|
+
"kind": "field",
|
|
32174
|
+
"name": "helpText",
|
|
32175
|
+
"type": {
|
|
32176
|
+
"text": "string"
|
|
32177
|
+
},
|
|
32178
|
+
"default": "''",
|
|
32179
|
+
"description": "The rating's help text. If you need to display HTML, use the `help-text` slot instead.",
|
|
32180
|
+
"attribute": "help-text"
|
|
32181
|
+
},
|
|
32134
32182
|
{
|
|
32135
32183
|
"kind": "field",
|
|
32136
32184
|
"name": "name",
|
|
@@ -32184,6 +32232,16 @@
|
|
|
32184
32232
|
"default": "false",
|
|
32185
32233
|
"attribute": "disabled"
|
|
32186
32234
|
},
|
|
32235
|
+
{
|
|
32236
|
+
"kind": "field",
|
|
32237
|
+
"name": "preview",
|
|
32238
|
+
"type": {
|
|
32239
|
+
"text": "boolean"
|
|
32240
|
+
},
|
|
32241
|
+
"default": "false",
|
|
32242
|
+
"description": "Displays the value alongside the symbols, updating live as the pointer moves across them.",
|
|
32243
|
+
"attribute": "preview"
|
|
32244
|
+
},
|
|
32187
32245
|
{
|
|
32188
32246
|
"kind": "field",
|
|
32189
32247
|
"name": "size",
|
|
@@ -32285,6 +32343,24 @@
|
|
|
32285
32343
|
}
|
|
32286
32344
|
]
|
|
32287
32345
|
},
|
|
32346
|
+
{
|
|
32347
|
+
"kind": "method",
|
|
32348
|
+
"name": "_formatValue",
|
|
32349
|
+
"privacy": "private",
|
|
32350
|
+
"return": {
|
|
32351
|
+
"type": {
|
|
32352
|
+
"text": "string"
|
|
32353
|
+
}
|
|
32354
|
+
},
|
|
32355
|
+
"parameters": [
|
|
32356
|
+
{
|
|
32357
|
+
"name": "value",
|
|
32358
|
+
"type": {
|
|
32359
|
+
"text": "number"
|
|
32360
|
+
}
|
|
32361
|
+
}
|
|
32362
|
+
]
|
|
32363
|
+
},
|
|
32288
32364
|
{
|
|
32289
32365
|
"kind": "method",
|
|
32290
32366
|
"name": "_getValueFromMousePosition",
|
|
@@ -32432,6 +32508,15 @@
|
|
|
32432
32508
|
},
|
|
32433
32509
|
"fieldName": "label"
|
|
32434
32510
|
},
|
|
32511
|
+
{
|
|
32512
|
+
"name": "help-text",
|
|
32513
|
+
"type": {
|
|
32514
|
+
"text": "string"
|
|
32515
|
+
},
|
|
32516
|
+
"default": "''",
|
|
32517
|
+
"description": "The rating's help text. If you need to display HTML, use the `help-text` slot instead.",
|
|
32518
|
+
"fieldName": "helpText"
|
|
32519
|
+
},
|
|
32435
32520
|
{
|
|
32436
32521
|
"name": "name",
|
|
32437
32522
|
"type": {
|
|
@@ -32479,6 +32564,15 @@
|
|
|
32479
32564
|
"default": "false",
|
|
32480
32565
|
"fieldName": "disabled"
|
|
32481
32566
|
},
|
|
32567
|
+
{
|
|
32568
|
+
"name": "preview",
|
|
32569
|
+
"type": {
|
|
32570
|
+
"text": "boolean"
|
|
32571
|
+
},
|
|
32572
|
+
"default": "false",
|
|
32573
|
+
"description": "Displays the value alongside the symbols, updating live as the pointer moves across them.",
|
|
32574
|
+
"fieldName": "preview"
|
|
32575
|
+
},
|
|
32482
32576
|
{
|
|
32483
32577
|
"name": "size",
|
|
32484
32578
|
"type": {
|
|
@@ -32503,7 +32597,7 @@
|
|
|
32503
32597
|
"tagNameWithoutPrefix": "rating",
|
|
32504
32598
|
"tagName": "zn-rating",
|
|
32505
32599
|
"customElement": true,
|
|
32506
|
-
"jsDoc": "/**\n * @summary Short summary of the component's intended use.\n * @documentation https://zinc.style/components/rating\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-example\n *\n * @event zn-event-name - Emitted as an example.\n *\n * @slot - The default slot.\n * @slot example - An example slot.\n *\n * @csspart base - The component's base wrapper.\n *\n * @cssproperty --example - An example CSS custom property.\n */",
|
|
32600
|
+
"jsDoc": "/**\n * @summary Short summary of the component's intended use.\n * @documentation https://zinc.style/components/rating\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-example\n *\n * @event zn-event-name - Emitted as an example.\n *\n * @slot - The default slot.\n * @slot example - An example slot.\n * @slot help-text - Text that describes how to use the rating. Alternatively, you can use the `help-text` attribute.\n *\n * @csspart form-control - The form control that wraps the symbols and help text.\n * @csspart form-control-help-text - The help text's wrapper.\n * @csspart base - The component's base wrapper.\n * @csspart preview - The value shown next to the symbols when `preview` is enabled.\n *\n * @cssproperty --example - An example CSS custom property.\n * @cssproperty --preview-color - The color of the preview value.\n * @cssproperty --preview-size - The font size of the preview value.\n */",
|
|
32507
32601
|
"documentation": "https://zinc.style/components/rating",
|
|
32508
32602
|
"status": "experimental",
|
|
32509
32603
|
"since": "1.0",
|
|
@@ -44374,7 +44468,7 @@
|
|
|
44374
44468
|
"package": {
|
|
44375
44469
|
"name": "@kubex/zinc",
|
|
44376
44470
|
"description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
|
|
44377
|
-
"version": "1.1.
|
|
44471
|
+
"version": "1.1.79",
|
|
44378
44472
|
"author": "",
|
|
44379
44473
|
"license": "MIT"
|
|
44380
44474
|
}
|
|
@@ -3302,15 +3302,25 @@
|
|
|
3302
3302
|
},
|
|
3303
3303
|
{
|
|
3304
3304
|
"name": "zn-rating",
|
|
3305
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Methods:**\n - **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity()** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
3305
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Methods:**\n - **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity()** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n- **help-text** - Text that describes how to use the rating. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n- **--preview-color** - The color of the preview value. _(default: undefined)_\n- **--preview-size** - The font size of the preview value. _(default: undefined)_\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the symbols and help text.\n- **form-control-help-text** - The help text's wrapper.\n- **base** - The component's base wrapper.\n- **preview** - The value shown next to the symbols when `preview` is enabled.",
|
|
3306
3306
|
"attributes": [
|
|
3307
3307
|
{ "name": "label", "values": [] },
|
|
3308
|
+
{
|
|
3309
|
+
"name": "help-text",
|
|
3310
|
+
"description": "The rating's help text. If you need to display HTML, use the `help-text` slot instead.",
|
|
3311
|
+
"values": []
|
|
3312
|
+
},
|
|
3308
3313
|
{ "name": "name", "values": [] },
|
|
3309
3314
|
{ "name": "value", "values": [] },
|
|
3310
3315
|
{ "name": "max", "values": [] },
|
|
3311
3316
|
{ "name": "precision", "values": [] },
|
|
3312
3317
|
{ "name": "readonly", "values": [] },
|
|
3313
3318
|
{ "name": "disabled", "values": [] },
|
|
3319
|
+
{
|
|
3320
|
+
"name": "preview",
|
|
3321
|
+
"description": "Displays the value alongside the symbols, updating live as the pointer moves across them.",
|
|
3322
|
+
"values": []
|
|
3323
|
+
},
|
|
3314
3324
|
{
|
|
3315
3325
|
"name": "size",
|
|
3316
3326
|
"values": [
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@kubex/zinc",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.79",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -7709,10 +7709,15 @@
|
|
|
7709
7709
|
},
|
|
7710
7710
|
{
|
|
7711
7711
|
"name": "zn-rating",
|
|
7712
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Methods:**\n - **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity()** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
7712
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Methods:**\n - **checkValidity(): _boolean_** - Checks the validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity()** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n- **help-text** - Text that describes how to use the rating. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n- **--preview-color** - The color of the preview value. _(default: undefined)_\n- **--preview-size** - The font size of the preview value. _(default: undefined)_\n\n### **CSS Parts:**\n - **form-control** - The form control that wraps the symbols and help text.\n- **form-control-help-text** - The help text's wrapper.\n- **base** - The component's base wrapper.\n- **preview** - The value shown next to the symbols when `preview` is enabled.",
|
|
7713
7713
|
"doc-url": "",
|
|
7714
7714
|
"attributes": [
|
|
7715
7715
|
{ "name": "label", "value": { "type": "string" } },
|
|
7716
|
+
{
|
|
7717
|
+
"name": "help-text",
|
|
7718
|
+
"description": "The rating's help text. If you need to display HTML, use the `help-text` slot instead.",
|
|
7719
|
+
"value": { "type": "string", "default": "''" }
|
|
7720
|
+
},
|
|
7716
7721
|
{ "name": "name", "value": { "type": "string" } },
|
|
7717
7722
|
{ "name": "value", "value": { "type": "number", "default": "0" } },
|
|
7718
7723
|
{ "name": "max", "value": { "type": "number", "default": "5" } },
|
|
@@ -7728,6 +7733,11 @@
|
|
|
7728
7733
|
"name": "disabled",
|
|
7729
7734
|
"value": { "type": "boolean", "default": "false" }
|
|
7730
7735
|
},
|
|
7736
|
+
{
|
|
7737
|
+
"name": "preview",
|
|
7738
|
+
"description": "Displays the value alongside the symbols, updating live as the pointer moves across them.",
|
|
7739
|
+
"value": { "type": "boolean", "default": "false" }
|
|
7740
|
+
},
|
|
7731
7741
|
{
|
|
7732
7742
|
"name": "size",
|
|
7733
7743
|
"value": {
|
|
@@ -7742,7 +7752,11 @@
|
|
|
7742
7752
|
],
|
|
7743
7753
|
"slots": [
|
|
7744
7754
|
{ "name": "", "description": "The default slot." },
|
|
7745
|
-
{ "name": "example", "description": "An example slot." }
|
|
7755
|
+
{ "name": "example", "description": "An example slot." },
|
|
7756
|
+
{
|
|
7757
|
+
"name": "help-text",
|
|
7758
|
+
"description": "Text that describes how to use the rating. Alternatively, you can use the `help-text` attribute."
|
|
7759
|
+
}
|
|
7746
7760
|
],
|
|
7747
7761
|
"events": [
|
|
7748
7762
|
{ "name": "zn-event-name", "description": "Emitted as an example." }
|
|
@@ -7750,13 +7764,24 @@
|
|
|
7750
7764
|
"js": {
|
|
7751
7765
|
"properties": [
|
|
7752
7766
|
{ "name": "rating", "type": "HTMLElement" },
|
|
7767
|
+
{ "name": "symbols", "type": "HTMLElement" },
|
|
7753
7768
|
{ "name": "label", "type": "string" },
|
|
7769
|
+
{
|
|
7770
|
+
"name": "helpText",
|
|
7771
|
+
"description": "The rating's help text. If you need to display HTML, use the `help-text` slot instead.",
|
|
7772
|
+
"type": "string"
|
|
7773
|
+
},
|
|
7754
7774
|
{ "name": "name", "type": "string" },
|
|
7755
7775
|
{ "name": "value", "type": "number" },
|
|
7756
7776
|
{ "name": "max", "type": "number" },
|
|
7757
7777
|
{ "name": "precision", "type": "number" },
|
|
7758
7778
|
{ "name": "readonly", "type": "boolean" },
|
|
7759
7779
|
{ "name": "disabled", "type": "boolean" },
|
|
7780
|
+
{
|
|
7781
|
+
"name": "preview",
|
|
7782
|
+
"description": "Displays the value alongside the symbols, updating live as the pointer moves across them.",
|
|
7783
|
+
"type": "boolean"
|
|
7784
|
+
},
|
|
7760
7785
|
{ "name": "size", "type": "'small' | 'medium' | 'large'" },
|
|
7761
7786
|
{ "name": "getSymbol", "type": "(value: number) => string" },
|
|
7762
7787
|
{
|
package/dist/zn.d.ts
CHANGED
|
@@ -6939,24 +6939,36 @@ declare module "components/rating/rating.component" {
|
|
|
6939
6939
|
*
|
|
6940
6940
|
* @slot - The default slot.
|
|
6941
6941
|
* @slot example - An example slot.
|
|
6942
|
+
* @slot help-text - Text that describes how to use the rating. Alternatively, you can use the `help-text` attribute.
|
|
6942
6943
|
*
|
|
6944
|
+
* @csspart form-control - The form control that wraps the symbols and help text.
|
|
6945
|
+
* @csspart form-control-help-text - The help text's wrapper.
|
|
6943
6946
|
* @csspart base - The component's base wrapper.
|
|
6947
|
+
* @csspart preview - The value shown next to the symbols when `preview` is enabled.
|
|
6944
6948
|
*
|
|
6945
6949
|
* @cssproperty --example - An example CSS custom property.
|
|
6950
|
+
* @cssproperty --preview-color - The color of the preview value.
|
|
6951
|
+
* @cssproperty --preview-size - The font size of the preview value.
|
|
6946
6952
|
*/
|
|
6947
6953
|
export default class ZnRating extends ZincElement implements ZincFormControl {
|
|
6948
6954
|
static styles: CSSResultGroup;
|
|
6949
6955
|
private readonly formControlController;
|
|
6956
|
+
private readonly hasSlotController;
|
|
6950
6957
|
rating: HTMLElement;
|
|
6958
|
+
symbols: HTMLElement;
|
|
6951
6959
|
private hoverValue;
|
|
6952
6960
|
private isHovering;
|
|
6953
6961
|
label: string;
|
|
6962
|
+
/** The rating's help text. If you need to display HTML, use the `help-text` slot instead. */
|
|
6963
|
+
helpText: string;
|
|
6954
6964
|
name: string;
|
|
6955
6965
|
value: number;
|
|
6956
6966
|
max: number;
|
|
6957
6967
|
precision: number;
|
|
6958
6968
|
readonly: boolean;
|
|
6959
6969
|
disabled: boolean;
|
|
6970
|
+
/** Displays the value alongside the symbols, updating live as the pointer moves across them. */
|
|
6971
|
+
preview: boolean;
|
|
6960
6972
|
size: 'small' | 'medium' | 'large';
|
|
6961
6973
|
getSymbol: (value: number) => string;
|
|
6962
6974
|
/** Gets the validity state object */
|
|
@@ -6973,6 +6985,7 @@ declare module "components/rating/rating.component" {
|
|
|
6973
6985
|
setCustomValidity(): void;
|
|
6974
6986
|
private _roundToPrecision;
|
|
6975
6987
|
private _getValueFromXCoordinate;
|
|
6988
|
+
private _formatValue;
|
|
6976
6989
|
private _getValueFromMousePosition;
|
|
6977
6990
|
private _getValueFromTouchPosition;
|
|
6978
6991
|
private _setValue;
|