shirkasoft-ui-components 1.3.9 → 1.3.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/README.md +23 -2
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs +267 -15
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-modal.mjs +5 -2
- package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-price-input.mjs +37 -2
- package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-select.mjs +15 -5
- package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-table.mjs +4 -3
- package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-utils.mjs +64 -2
- package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/src/theme.css +9 -0
- package/types/shirkasoft-ui-components-date-picker.d.ts +65 -2
- package/types/shirkasoft-ui-components-modal.d.ts +4 -1
- package/types/shirkasoft-ui-components-price-input.d.ts +10 -0
- package/types/shirkasoft-ui-components-select.d.ts +2 -0
- package/types/shirkasoft-ui-components-utils.d.ts +44 -1
package/README.md
CHANGED
|
@@ -224,7 +224,7 @@ interface SelectOption {
|
|
|
224
224
|
|
|
225
225
|
### DatePicker (`shk-date-picker`)
|
|
226
226
|
|
|
227
|
-
Date, month, or year picker. Implements `ControlValueAccessor`. Supports `'date'`, `'month'`, `'year'` views.
|
|
227
|
+
Date, week, month, or year picker with optional time selection. Implements `ControlValueAccessor`. Supports `'date'`, `'week'`, `'month'`, `'year'` views.
|
|
228
228
|
|
|
229
229
|
```html
|
|
230
230
|
<shk-date-picker
|
|
@@ -245,19 +245,40 @@ Date, month, or year picker. Implements `ControlValueAccessor`. Supports `'date'
|
|
|
245
245
|
| `view` | `'date' \| 'month' \| 'year'` | `'date'` |
|
|
246
246
|
| `control` | `FormControl` | `undefined` |
|
|
247
247
|
| `formGroup` | `FormGroup` | `undefined` |
|
|
248
|
+
| `controlName` | `string` | `''` |
|
|
248
249
|
| `disabled` | `boolean` | `false` |
|
|
249
250
|
| `errorMessage` | `string` | `''` |
|
|
250
251
|
| `errorMessages` | `{ [key: string]: string }` | `{}` |
|
|
251
252
|
| `minValue` | `string` | `''` |
|
|
252
253
|
| `maxValue` | `string` | `''` |
|
|
253
254
|
| `locale` | `string` | `'es'` |
|
|
255
|
+
| `valueFormat` | `string` | `''` |
|
|
254
256
|
|
|
255
|
-
**Return value** depends on `view`:
|
|
257
|
+
**Return value** (when `valueFormat` is empty) depends on `view`:
|
|
256
258
|
|
|
257
259
|
- `'date'` → `'YYYY-MM-DD'`
|
|
258
260
|
- `'month'` → `'YYYY-MM'`
|
|
259
261
|
- `'year'` → `'YYYY'`
|
|
260
262
|
|
|
263
|
+
#### Custom value format (`valueFormat`)
|
|
264
|
+
|
|
265
|
+
Use `valueFormat` to set the format in which the form control **receives and returns** the date. Supported tokens: `YYYY`, `MM`, `DD`, `HH`, `mm`, `ss`, with any separator.
|
|
266
|
+
|
|
267
|
+
```html
|
|
268
|
+
<!-- control value: '05-05-2026' -->
|
|
269
|
+
<shk-date-picker [control]="dateControl" valueFormat="DD-MM-YYYY" />
|
|
270
|
+
|
|
271
|
+
<!-- control value: '05/05/2026 14:30' -->
|
|
272
|
+
<shk-date-picker [control]="dateTimeControl" [showTime]="true" valueFormat="DD/MM/YYYY HH:mm" />
|
|
273
|
+
|
|
274
|
+
<!-- control value: '05/2026' -->
|
|
275
|
+
<shk-date-picker [control]="monthControl" view="month" valueFormat="MM/YYYY" />
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
- Without `valueFormat`, the ISO formats above are used (backwards compatible).
|
|
279
|
+
- `minValue` / `maxValue` still use ISO (`YYYY-MM-DD`).
|
|
280
|
+
- Values that cannot be parsed are ignored (a `console.warn` is logged) instead of breaking the component.
|
|
281
|
+
|
|
261
282
|
---
|
|
262
283
|
|
|
263
284
|
### PriceInput (`shk-price-input`)
|