@oliasoft-open-source/react-ui-library 10.0.0-beta-19 → 10.0.0-beta-20
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 +18 -19
- package/dist/index.d.ts +1 -6
- package/dist/index.js +32 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1679,25 +1679,24 @@ The `Select` component is used to render a dropdown menu for selecting options f
|
|
|
1679
1679
|
|
|
1680
1680
|
### Props
|
|
1681
1681
|
|
|
1682
|
-
| Prop | Description
|
|
1683
|
-
| -------------------------- |
|
|
1684
|
-
| `name` | The name attribute of the select element.
|
|
1685
|
-
| `multi` | Determines whether multiple options can be selected.
|
|
1686
|
-
| `options` | An array of options to be rendered in the dropdown menu.
|
|
1687
|
-
| `value` | The currently selected option(s).
|
|
1688
|
-
| `native` | Determines whether to use the native HTML `<select>` element.
|
|
1689
|
-
| `onChange` | A callback function invoked when the selection changes.
|
|
1690
|
-
| `onCreate` | A callback function invoked when a new option is created.
|
|
1691
|
-
| `
|
|
1692
|
-
| `
|
|
1693
|
-
| `
|
|
1694
|
-
| `
|
|
1695
|
-
| `
|
|
1696
|
-
| `
|
|
1697
|
-
| `
|
|
1698
|
-
| `
|
|
1699
|
-
| `
|
|
1700
|
-
| `disabled` | Determines whether the select component is disabled. | `false` |
|
|
1682
|
+
| Prop | Description | Default Value |
|
|
1683
|
+
| -------------------------- | ----------------------------------------------------------------------- | ------------- |
|
|
1684
|
+
| `name` | The name attribute of the select element. | `''` |
|
|
1685
|
+
| `multi` | Determines whether multiple options can be selected. | `false` |
|
|
1686
|
+
| `options` | An array of options to be rendered in the dropdown menu. | `[]` |
|
|
1687
|
+
| `value` | The currently selected option(s). | - |
|
|
1688
|
+
| `native` | Determines whether to use the native HTML `<select>` element. | `false` |
|
|
1689
|
+
| `onChange` | A callback function invoked when the selection changes. | `() => {}` |
|
|
1690
|
+
| `onCreate` | A callback function invoked when a new option is created. | `() => {}` |
|
|
1691
|
+
| `warning` | Warning message to be displayed. | - |
|
|
1692
|
+
| `error` | Error message to be displayed. | - |
|
|
1693
|
+
| `checkNonExistentValues` | Determines whether to check for non-existent values. | `true` |
|
|
1694
|
+
| `closeOnOptionActionClick` | Determines whether to close the select dropdown on option action click. | `true` |
|
|
1695
|
+
| `isInTable` | **Internal.** For Table cell composition only. | `false` |
|
|
1696
|
+
| `right` | Right-aligns select text. | `false` |
|
|
1697
|
+
| `groupOrder` | **Internal.** For InputGroup composition only. | - |
|
|
1698
|
+
| `testId` | A string used to identify the select component for testing purposes. | - |
|
|
1699
|
+
| `disabled` | Determines whether the select component is disabled. | `false` |
|
|
1701
1700
|
|
|
1702
1701
|
The `ISelectSelectedOption` interface represents the structure of an option in the dropdown menu.
|
|
1703
1702
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1400,7 +1400,6 @@ declare interface ISelectCell extends TCommonCell {
|
|
|
1400
1400
|
native?: boolean;
|
|
1401
1401
|
clearable?: boolean;
|
|
1402
1402
|
searchable?: boolean;
|
|
1403
|
-
deprecatedEventHandler?: boolean;
|
|
1404
1403
|
maxTooltipWidth?: TStringOrNumber;
|
|
1405
1404
|
autoLayerWidth?: boolean;
|
|
1406
1405
|
multi?: boolean;
|
|
@@ -1413,13 +1412,9 @@ export declare interface ISelectProps {
|
|
|
1413
1412
|
value?: any;
|
|
1414
1413
|
native?: boolean;
|
|
1415
1414
|
onChange?: TChangeEventHandler;
|
|
1416
|
-
/** @deprecated Use the standard onChange event shape instead. */
|
|
1417
|
-
deprecatedEventHandler?: boolean;
|
|
1418
1415
|
warning?: TStringOrNumber | ReactNode;
|
|
1419
1416
|
error?: TStringOrNumber | ReactNode;
|
|
1420
|
-
/** @deprecated Prefer leaving unset (defaults to true). */
|
|
1421
1417
|
checkNonExistentValues?: boolean;
|
|
1422
|
-
/** @deprecated Always closes on option action click. */
|
|
1423
1418
|
closeOnOptionActionClick?: boolean;
|
|
1424
1419
|
small?: boolean;
|
|
1425
1420
|
width?: TStringOrNumber | null;
|
|
@@ -1431,7 +1426,7 @@ export declare interface ISelectProps {
|
|
|
1431
1426
|
searchable?: boolean;
|
|
1432
1427
|
maxTooltipWidth?: TStringOrNumber;
|
|
1433
1428
|
autoLayerWidth?: boolean;
|
|
1434
|
-
|
|
1429
|
+
right?: boolean;
|
|
1435
1430
|
/* Excluded from this release type: groupOrder */
|
|
1436
1431
|
tabIndex?: number;
|
|
1437
1432
|
testId?: string;
|
package/dist/index.js
CHANGED
|
@@ -3250,45 +3250,40 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3250
3250
|
hasNonExistentValue: n && s !== void 0 ? Xc(o, s) : !1
|
|
3251
3251
|
};
|
|
3252
3252
|
}, Qc = (e) => {
|
|
3253
|
-
let { name: t = "", options: n = [], value: r, native: i = !1, onChange: a = yn,
|
|
3254
|
-
i && !
|
|
3255
|
-
let
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
e
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
value: r,
|
|
3266
|
-
label: h ? void 0 : n.label
|
|
3267
|
-
}
|
|
3268
|
-
});
|
|
3269
|
-
}
|
|
3253
|
+
let { name: t = "", options: n = [], value: r, native: i = !1, onChange: a = yn, warning: o, error: s, checkNonExistentValues: c = !0, closeOnOptionActionClick: l = !0, testId: u, disabled: d, multi: f, ...p } = e, { multi: m, options: h, selectedOptions: g, hasNonExistentValue: _ } = Zc(n, r, c), v = !m, y = i && v;
|
|
3254
|
+
i && !v && console.warn("Native select does not support provided props (see stories)");
|
|
3255
|
+
let b = "Value no longer available for re-selection", x = _ && !d ? o ? /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("div", { children: b }), /* @__PURE__ */ S("div", { children: o })] }) : b : o, w = _ && s && !d ? /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("div", { children: b }), /* @__PURE__ */ S("div", { children: s })] }) : s, T = (e, n) => {
|
|
3256
|
+
let r = m ? n : n.value;
|
|
3257
|
+
a({
|
|
3258
|
+
...e,
|
|
3259
|
+
target: {
|
|
3260
|
+
name: t,
|
|
3261
|
+
value: r,
|
|
3262
|
+
label: m ? void 0 : n.label
|
|
3263
|
+
}
|
|
3264
|
+
});
|
|
3270
3265
|
};
|
|
3271
|
-
return
|
|
3272
|
-
...
|
|
3273
|
-
options:
|
|
3274
|
-
selectedOption:
|
|
3275
|
-
onChange:
|
|
3276
|
-
hasNonExistentValue:
|
|
3277
|
-
warning:
|
|
3278
|
-
error:
|
|
3279
|
-
testId:
|
|
3280
|
-
disabled:
|
|
3266
|
+
return y ? /* @__PURE__ */ S(oc, {
|
|
3267
|
+
...p,
|
|
3268
|
+
options: h,
|
|
3269
|
+
selectedOption: g,
|
|
3270
|
+
onChange: T,
|
|
3271
|
+
hasNonExistentValue: _,
|
|
3272
|
+
warning: x,
|
|
3273
|
+
error: w,
|
|
3274
|
+
testId: u,
|
|
3275
|
+
disabled: d
|
|
3281
3276
|
}) : /* @__PURE__ */ S(Hc, {
|
|
3282
|
-
...
|
|
3283
|
-
options:
|
|
3284
|
-
selectedOptions:
|
|
3285
|
-
onChange:
|
|
3286
|
-
multi:
|
|
3287
|
-
warning:
|
|
3288
|
-
error:
|
|
3289
|
-
testId:
|
|
3290
|
-
disabled:
|
|
3291
|
-
closeOnOptionActionClick:
|
|
3277
|
+
...p,
|
|
3278
|
+
options: h,
|
|
3279
|
+
selectedOptions: g,
|
|
3280
|
+
onChange: T,
|
|
3281
|
+
multi: m,
|
|
3282
|
+
warning: x,
|
|
3283
|
+
error: w,
|
|
3284
|
+
testId: u,
|
|
3285
|
+
disabled: d,
|
|
3286
|
+
closeOnOptionActionClick: l
|
|
3292
3287
|
});
|
|
3293
3288
|
}, $c = (e, t) => t || e && e.reduce((e, t) => t != null && t.selected ? Number(t == null ? void 0 : t.value) : e, 10) || 10, el = (e, t) => {
|
|
3294
3289
|
if (!t || !e) return 10;
|
|
@@ -3636,7 +3631,6 @@ var Ro = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), zo =
|
|
|
3636
3631
|
native: e.native,
|
|
3637
3632
|
clearable: e.clearable,
|
|
3638
3633
|
searchable: e.searchable,
|
|
3639
|
-
deprecatedEventHandler: e.deprecatedEventHandler,
|
|
3640
3634
|
maxTooltipWidth: e.maxTooltipWidth,
|
|
3641
3635
|
width: "100%",
|
|
3642
3636
|
autoLayerWidth: e.autoLayerWidth,
|
package/package.json
CHANGED