@nuralyui/slider-input 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,219 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { LitElement, html, css } from 'lit';
8
- import { customElement, property } from 'lit/decorators.js';
9
- let SliderInputDemi = class SliderInputDemi extends LitElement {
10
- constructor() {
11
- super(...arguments);
12
- this._sliderChangeViaTextboxValue = 15;
13
- this._sliderDisabled = false;
14
- this._sliderMinMaxNotMultipleOfStepValue = 45678;
15
- this._sliderWithChangeHandlerValue = 0;
16
- this.min = 0;
17
- this.max = 0;
18
- }
19
- /**
20
- * Sets the slider's disabled prop.
21
- */
22
- _toggleDisabled() {
23
- this._sliderDisabled = !this._sliderDisabled;
24
- }
25
- /**
26
- * Updates the slider prop's value.
27
- * @param {EventObject} e The event object.
28
- */
29
- _updateValue(e) {
30
- const [element] = e.composedPath();
31
- const { format, prop } = element.dataset;
32
- const propToUpdate = `_${(prop)}Value`;
33
- const value = format
34
- ? (element.value, JSON.parse(format))
35
- : element.value;
36
- this[propToUpdate] = value;
37
- }
38
- render() {
39
- return html `
40
- <fieldset>
41
- <legend>Default</legend>
42
- <hy-slider-input
43
- id="slider-default"
44
- .min=${0}
45
- .max=${100}
46
- .value=${20}
47
- ></hy-slider-input>
48
- </fieldset>
49
- <fieldset>
50
- <legend>With Change Handler</legend>
51
- <hy-slider-input
52
- id="slider-with-change-handler"
53
- data-prop="slider-with-change-handler"
54
- data-format=${JSON.stringify({
55
- options: {
56
- style: 'currency',
57
- currency: 'USD',
58
- },
59
- })}
60
- .min=${0}
61
- .max=${1000000}
62
- .step=${100000}
63
- .value=${400000}
64
- @change=${this._updateValue}
65
- ></hy-slider-input>
66
- <p class="slider-value">${this._sliderWithChangeHandlerValue}</p>
67
- </fieldset>
68
- <fieldset>
69
- <legend>Custom Styles</legend>
70
- <hy-slider-input
71
- id="slider-custom-styles"
72
- .min=${0}
73
- .max=${100}
74
- .value=${50}
75
- ></hy-slider-input>
76
- </fieldset>
77
- <fieldset id="toggle-disabled">
78
- <legend>Toggle Disabled Status</legend>
79
- <label for="chk-toggle-disabled">
80
- <input
81
- id="chk-toggle-disabled"
82
- type="checkbox"
83
- .checked=${this._sliderDisabled}
84
- @input=${this._toggleDisabled}
85
- />
86
- Disable Slider
87
- </label>
88
- <hy-slider-input
89
- id="slider-toggle-disabled"
90
- .disabled=${this._sliderDisabled}
91
- .min=${0}
92
- .max=${100}
93
- .value=${75}
94
- ></hy-slider-input>
95
- </fieldset>
96
- <fieldset id="change-via-textbox">
97
- <legend>Change via Textbox</legend>
98
- <input
99
- id="txt-change-via-textbox"
100
- data-prop="slider-change-via-textbox"
101
- max="100"
102
- min="0"
103
- type="number"
104
- .value=${this._sliderChangeViaTextboxValue}
105
- @input=${this._updateValue}
106
- />
107
- <hy-slider-input
108
- id="slider-change-via-textbox"
109
- data-prop="slider-change-via-textbox"
110
- .min=${0}
111
- .max=${100}
112
- .value=${this._sliderChangeViaTextboxValue}
113
- @change=${this._updateValue}
114
- ></hy-slider-input>
115
- </fieldset>
116
- <fieldset id="not-multiple-of-step">
117
- <legend>Not Multiple of Step</legend>
118
- <p>${(this._sliderMinMaxNotMultipleOfStepValue)}</p>
119
- <hy-slider-input
120
- id="slider-min-max-not-multiple-of-step"
121
- data-prop="slider-min-max-not-multiple-of-step"
122
- .min=${this.min}
123
- .max=${this.max}
124
- .step=${10000}
125
- .value=${this._sliderMinMaxNotMultipleOfStepValue}
126
- @change=${this._updateValue}
127
- ></hy-slider-input>
128
- <div class="slider-limits">
129
- <span>${(this.min)}</span>
130
- <span>${(this.max)}</span>
131
- </div>
132
- </fieldset>;`;
133
- }
134
- };
135
- SliderInputDemi.styles = [
136
- css `
137
- :host {
138
- --hy-slider-width: 129px;
139
-
140
- font: normal 14px/1.4 Helvetica, Arial, sans-serif;
141
- }
142
-
143
- fieldset {
144
- border: 0;
145
- display: flex;
146
- flex-direction: column;
147
- margin: 10px 0;
148
- padding: 10px;
149
- }
150
-
151
- legend {
152
- font-size: 20px;
153
- font-weight: 600;
154
- padding: 0;
155
- }
156
-
157
- range-slider {
158
- width: var(--hy-slider-width);
159
- }
160
-
161
- #slider-custom-styles {
162
- --hy-slider-height: 15px;
163
- --hy-slider-background: orange;
164
- --hy-slider-value-color: green;
165
- --hy-slider-thumb-color: pink;
166
- --hy-slider-thumb-diameter: 30px;
167
- }
168
-
169
- label {
170
- align-items: center;
171
- display: flex;
172
- margin: 0 0 10px;
173
- }
174
-
175
- p {
176
- margin: 0;
177
- }
178
-
179
- #chk-toggle-disabled {
180
- margin: 0 10px 0 0;
181
- }
182
-
183
- #txt-change-via-textbox,
184
- #slider-change-via-textbox,
185
- #slider-toggle-disabled {
186
- margin: 0 0 20px;
187
- width: var(--hy-slider-width);
188
- }
189
-
190
- .slider-limits {
191
- display: flex;
192
- justify-content: space-between;
193
- width: var(--hy-slider-width);
194
- }
195
- `
196
- ];
197
- __decorate([
198
- property({ type: Number })
199
- ], SliderInputDemi.prototype, "_sliderChangeViaTextboxValue", void 0);
200
- __decorate([
201
- property({ type: Boolean })
202
- ], SliderInputDemi.prototype, "_sliderDisabled", void 0);
203
- __decorate([
204
- property({ type: Number })
205
- ], SliderInputDemi.prototype, "_sliderMinMaxNotMultipleOfStepValue", void 0);
206
- __decorate([
207
- property({ type: Number })
208
- ], SliderInputDemi.prototype, "_sliderWithChangeHandlerValue", void 0);
209
- __decorate([
210
- property({ type: Number })
211
- ], SliderInputDemi.prototype, "min", void 0);
212
- __decorate([
213
- property({ type: Number })
214
- ], SliderInputDemi.prototype, "max", void 0);
215
- SliderInputDemi = __decorate([
216
- customElement('hy-slider-input-demo')
217
- ], SliderInputDemi);
218
- export { SliderInputDemi };
219
- //# sourceMappingURL=slider-input-demo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slider-input-demo.js","sourceRoot":"","sources":["../../../../src/components/slider-input/demo/slider-input-demo.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,UAAU;IAA/C;;QA+DkC,iCAA4B,GAAG,EAAE,CAAC;QACrC,oBAAe,GAAG,KAAK,CAAC;QACzB,wCAAmC,GAAG,KAAK,CAAC;QAC5C,kCAA6B,GAAG,CAAC,CAAC;QAClC,QAAG,GAAG,CAAC,CAAC;QACR,QAAG,GAAG,CAAC,CAAC;IAyHtC,CAAC;IAtHC;;OAEG;IACH,eAAe;QACb,IAAI,CAAC,eAAe,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACF,YAAY,CAAC,CAAM;QAClB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC;QACnC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;QACzC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM;YAClB,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACrC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QAEjB,IAAY,CAAC,YAAY,C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EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4EAA6C;AAC5C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAAmC;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAS;AACR;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAS;AApEzB,eAAe;IAD3B,aAAa,CAAC,sBAAsB,CAAC;GACzB,eAAe,CA6L3B;SA7LY,eAAe","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n@customElement('hy-slider-input-demo')\nexport class SliderInputDemi extends LitElement {\n static override styles = [\n css`\n :host {\n --hy-slider-width: 129px;\n\n font: normal 14px/1.4 Helvetica, Arial, sans-serif;\n }\n\n fieldset {\n border: 0;\n display: flex;\n flex-direction: column;\n margin: 10px 0;\n padding: 10px;\n }\n\n legend {\n font-size: 20px;\n font-weight: 600;\n padding: 0;\n }\n\n range-slider {\n width: var(--hy-slider-width);\n }\n\n #slider-custom-styles {\n --hy-slider-height: 15px;\n --hy-slider-background: orange;\n --hy-slider-value-color: green;\n --hy-slider-thumb-color: pink;\n --hy-slider-thumb-diameter: 30px;\n }\n\n label {\n align-items: center;\n display: flex;\n margin: 0 0 10px;\n }\n\n p {\n margin: 0;\n }\n\n #chk-toggle-disabled {\n margin: 0 10px 0 0;\n }\n\n #txt-change-via-textbox,\n #slider-change-via-textbox,\n #slider-toggle-disabled {\n margin: 0 0 20px;\n width: var(--hy-slider-width);\n }\n\n .slider-limits {\n display: flex;\n justify-content: space-between;\n width: var(--hy-slider-width);\n }\n `\n ];\n @property({ type: Number }) _sliderChangeViaTextboxValue = 15;\n @property({ type: Boolean }) _sliderDisabled = false;\n @property({ type: Number }) _sliderMinMaxNotMultipleOfStepValue = 45678;\n @property({ type: Number }) _sliderWithChangeHandlerValue = 0;\n @property({ type: Number }) min = 0;\n @property({ type: Number }) max = 0;\n\n\n /**\n * Sets the slider's disabled prop.\n */\n _toggleDisabled() {\n this._sliderDisabled = !this._sliderDisabled;\n }\n\n /**\n * Updates the slider prop's value.\n * @param {EventObject} e The event object.\n */\n _updateValue(e :any) {\n const [element] = e.composedPath();\n const { format, prop } = element.dataset;\n const propToUpdate = `_${(prop)}Value`;\n const value = format\n ? (element.value, JSON.parse(format))\n : element.value;\n\n (this as any)[propToUpdate] = value;\n }\n\n override render() {\n return html`\n <fieldset>\n <legend>Default</legend>\n <hy-slider-input\n id=\"slider-default\"\n .min=${0}\n .max=${100}\n .value=${20}\n ></hy-slider-input>\n </fieldset>\n <fieldset>\n <legend>With Change Handler</legend>\n <hy-slider-input\n id=\"slider-with-change-handler\"\n data-prop=\"slider-with-change-handler\"\n data-format=${JSON.stringify({\n options: {\n style: 'currency',\n currency: 'USD',\n },\n })}\n .min=${0}\n .max=${1000000}\n .step=${100000}\n .value=${400000}\n @change=${this._updateValue}\n ></hy-slider-input>\n <p class=\"slider-value\">${this._sliderWithChangeHandlerValue}</p>\n </fieldset>\n <fieldset>\n <legend>Custom Styles</legend>\n <hy-slider-input\n id=\"slider-custom-styles\"\n .min=${0}\n .max=${100}\n .value=${50}\n ></hy-slider-input>\n </fieldset>\n <fieldset id=\"toggle-disabled\">\n <legend>Toggle Disabled Status</legend>\n <label for=\"chk-toggle-disabled\">\n <input\n id=\"chk-toggle-disabled\"\n type=\"checkbox\"\n .checked=${this._sliderDisabled}\n @input=${this._toggleDisabled}\n />\n Disable Slider\n </label>\n <hy-slider-input\n id=\"slider-toggle-disabled\"\n .disabled=${this._sliderDisabled}\n .min=${0}\n .max=${100}\n .value=${75}\n ></hy-slider-input>\n </fieldset>\n <fieldset id=\"change-via-textbox\">\n <legend>Change via Textbox</legend>\n <input\n id=\"txt-change-via-textbox\"\n data-prop=\"slider-change-via-textbox\"\n max=\"100\"\n min=\"0\"\n type=\"number\"\n .value=${this._sliderChangeViaTextboxValue}\n @input=${this._updateValue}\n />\n <hy-slider-input\n id=\"slider-change-via-textbox\"\n data-prop=\"slider-change-via-textbox\"\n .min=${0}\n .max=${100}\n .value=${this._sliderChangeViaTextboxValue}\n @change=${this._updateValue}\n ></hy-slider-input>\n </fieldset>\n <fieldset id=\"not-multiple-of-step\">\n <legend>Not Multiple of Step</legend>\n <p>${(this._sliderMinMaxNotMultipleOfStepValue)}</p>\n <hy-slider-input\n id=\"slider-min-max-not-multiple-of-step\"\n data-prop=\"slider-min-max-not-multiple-of-step\"\n .min=${this.min}\n .max=${this.max}\n .step=${10000}\n .value=${this._sliderMinMaxNotMultipleOfStepValue}\n @change=${this._updateValue}\n ></hy-slider-input>\n <div class=\"slider-limits\">\n <span>${(this.min)}</span>\n <span>${(this.max)}</span>\n </div>\n </fieldset>;`\n }\n}\n"]}
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/slider-input/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
package/react.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/components/slider-input/react.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQxB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"slider-input.component.d.ts","sourceRoot":"","sources":["../../../src/components/slider-input/slider-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAKzD,qBAAa,WAAY,SAAQ,UAAU;IAG1C,QAAQ,UAAS;IAGjB,GAAG,SAAO;IAGV,GAAG,SAAK;IAGR,IAAI,SAAK;IAGT,KAAK,SAAK;IAGV,UAAU,SAAK;IAGf,UAAU,SAAK;IAIf,MAAM,EAAG,gBAAgB,GAAG,IAAI,CAAC;IAEjC,OAAO,EAAI,gBAAgB,GAAG,IAAI,CAAC;IAEnC,MAAM,EAAI,gBAAgB,GAAG,IAAI,CAAC;IAElC,OAAgB,MAAM,0BAAU;IAGjB,YAAY;IAmBlB,MAAM;IAmBN,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,GAAG,CAAC;IAMpD;;OAEG;IACH,cAAc;IASd;;;OAGG;IACH,aAAa,sCAoBX;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"slider-input.style.d.ts","sourceRoot":"","sources":["../../../src/components/slider-input/slider-input.style.ts"],"names":[],"mappings":";AAEA,wBA0EE"}
package/utils.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function debounce(func: Function, wait?: number): (this: any, ...args: any[]) => void;
2
- //# sourceMappingURL=utils.d.ts.map
package/utils.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/slider-input/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,SAAM,UAE3B,GAAG,WAAS,GAAG,EAAE,UAIrC"}
package/utils.js DELETED
@@ -1,8 +0,0 @@
1
- export function debounce(func, wait = 100) {
2
- let timeout;
3
- return function (...args) {
4
- clearTimeout(timeout);
5
- timeout = setTimeout(() => func.apply(this, args), wait);
6
- };
7
- }
8
- //# sourceMappingURL=utils.js.map
package/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/slider-input/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,IAAa,EAAE,IAAI,GAAG,GAAG;IACjD,IAAI,OAAsB,CAAC;IAC3B,OAAO,UAAmB,GAAG,IAAU;QACrC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC;AACD,CAAC","sourcesContent":["export function debounce(func:Function, wait = 100) {\n\tlet timeout:NodeJS.Timeout;\n\treturn function (this:any,...args:any[]) {\n\t clearTimeout(timeout);\n\t timeout = setTimeout(() => func.apply(this , args), wait);\n\t};\n }"]}