@plasmicpkgs/react-aria 0.0.49 → 0.0.51
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/.tsbuildinfo +1 -1
- package/dist/ListBoxItemIdManager.d.ts +13 -0
- package/dist/common.d.ts +0 -2
- package/dist/contexts.d.ts +4 -5
- package/dist/react-aria.esm.js +712 -843
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +710 -841
- package/dist/react-aria.js.map +1 -1
- package/dist/registerComboBox.d.ts +9 -17
- package/dist/registerListBox.d.ts +16 -6
- package/dist/registerListBoxItem.d.ts +13 -3
- package/dist/registerSection.d.ts +2 -4
- package/dist/registerSelect.d.ts +9 -18
- package/package.json +2 -2
- package/skinny/ListBoxItemIdManager.d.ts +13 -0
- package/skinny/{common-fa69e9b3.esm.js → common-8ca74873.esm.js} +4 -72
- package/skinny/common-8ca74873.esm.js.map +1 -0
- package/skinny/{common-bfedaf7d.cjs.js → common-c892c339.cjs.js} +4 -82
- package/skinny/common-c892c339.cjs.js.map +1 -0
- package/skinny/common.d.ts +0 -2
- package/skinny/contexts-0a2977d8.esm.js +15 -0
- package/skinny/contexts-0a2977d8.esm.js.map +1 -0
- package/skinny/{contexts-0dec6156.cjs.js → contexts-c26d68f8.cjs.js} +3 -9
- package/skinny/contexts-c26d68f8.cjs.js.map +1 -0
- package/skinny/contexts.d.ts +4 -5
- package/skinny/{interaction-variant-utils-abd0c319.esm.js → interaction-variant-utils-1d94d073.esm.js} +2 -2
- package/skinny/interaction-variant-utils-1d94d073.esm.js.map +1 -0
- package/skinny/{interaction-variant-utils-36f1b397.cjs.js → interaction-variant-utils-9a869063.cjs.js} +2 -2
- package/skinny/interaction-variant-utils-9a869063.cjs.js.map +1 -0
- package/skinny/registerButton.cjs.js +6 -4
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +4 -2
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +6 -5
- package/skinny/registerCheckbox.cjs.js.map +1 -1
- package/skinny/registerCheckbox.esm.js +4 -3
- package/skinny/registerCheckbox.esm.js.map +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +8 -7
- package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
- package/skinny/registerCheckboxGroup.esm.js +5 -4
- package/skinny/registerCheckboxGroup.esm.js.map +1 -1
- package/skinny/registerComboBox.cjs.js +73 -253
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.d.ts +9 -17
- package/skinny/registerComboBox.esm.js +74 -254
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDescription.cjs.js +2 -2
- package/skinny/registerDescription.cjs.js.map +1 -1
- package/skinny/registerDescription.esm.js +1 -1
- package/skinny/registerDialogTrigger.cjs.js +6 -5
- package/skinny/registerDialogTrigger.cjs.js.map +1 -1
- package/skinny/registerDialogTrigger.esm.js +4 -3
- package/skinny/registerDialogTrigger.esm.js.map +1 -1
- package/skinny/registerFieldError.cjs.js +3 -3
- package/skinny/registerFieldError.cjs.js.map +1 -1
- package/skinny/registerFieldError.esm.js +1 -1
- package/skinny/registerForm.cjs.js +3 -3
- package/skinny/registerForm.cjs.js.map +1 -1
- package/skinny/registerForm.esm.js +1 -1
- package/skinny/registerInput.cjs.js +7 -6
- package/skinny/registerInput.cjs.js.map +1 -1
- package/skinny/registerInput.esm.js +5 -4
- package/skinny/registerInput.esm.js.map +1 -1
- package/skinny/registerLabel.cjs.js +3 -3
- package/skinny/registerLabel.cjs.js.map +1 -1
- package/skinny/registerLabel.esm.js +1 -1
- package/skinny/registerListBox-85f61377.esm.js +321 -0
- package/skinny/registerListBox-85f61377.esm.js.map +1 -0
- package/skinny/registerListBox-96ae5783.cjs.js +331 -0
- package/skinny/registerListBox-96ae5783.cjs.js.map +1 -0
- package/skinny/registerListBox.cjs.js +7 -7
- package/skinny/registerListBox.d.ts +16 -6
- package/skinny/registerListBox.esm.js +6 -7
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +96 -13
- package/skinny/registerListBoxItem.cjs.js.map +1 -1
- package/skinny/registerListBoxItem.d.ts +13 -3
- package/skinny/registerListBoxItem.esm.js +95 -12
- package/skinny/registerListBoxItem.esm.js.map +1 -1
- package/skinny/registerModal.cjs.js +5 -4
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.esm.js +3 -2
- package/skinny/registerModal.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +5 -6
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.esm.js +3 -4
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +6 -5
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.esm.js +4 -3
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +8 -7
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.esm.js +5 -4
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerSection.cjs.js +30 -25
- package/skinny/registerSection.cjs.js.map +1 -1
- package/skinny/registerSection.d.ts +2 -4
- package/skinny/registerSection.esm.js +29 -24
- package/skinny/registerSection.esm.js.map +1 -1
- package/skinny/registerSelect.cjs.js +65 -88
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.d.ts +9 -18
- package/skinny/registerSelect.esm.js +61 -84
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerSlider.cjs.js +9 -9
- package/skinny/registerSlider.cjs.js.map +1 -1
- package/skinny/registerSlider.esm.js +5 -5
- package/skinny/registerSliderOutput.cjs.js +4 -4
- package/skinny/registerSliderOutput.cjs.js.map +1 -1
- package/skinny/registerSliderOutput.esm.js +2 -2
- package/skinny/registerSliderThumb.cjs.js +23 -7
- package/skinny/registerSliderThumb.cjs.js.map +1 -1
- package/skinny/registerSliderThumb.esm.js +21 -5
- package/skinny/registerSliderThumb.esm.js.map +1 -1
- package/skinny/registerSliderTrack.cjs.js +7 -7
- package/skinny/registerSliderTrack.cjs.js.map +1 -1
- package/skinny/registerSliderTrack.esm.js +3 -3
- package/skinny/registerSwitch.cjs.js +6 -5
- package/skinny/registerSwitch.cjs.js.map +1 -1
- package/skinny/registerSwitch.esm.js +4 -3
- package/skinny/registerSwitch.esm.js.map +1 -1
- package/skinny/registerText.cjs.js +3 -3
- package/skinny/registerText.cjs.js.map +1 -1
- package/skinny/registerText.esm.js +1 -1
- package/skinny/registerTextArea.cjs.js +6 -5
- package/skinny/registerTextArea.cjs.js.map +1 -1
- package/skinny/registerTextArea.esm.js +4 -3
- package/skinny/registerTextArea.esm.js.map +1 -1
- package/skinny/registerTextField.cjs.js +8 -7
- package/skinny/registerTextField.cjs.js.map +1 -1
- package/skinny/registerTextField.esm.js +5 -4
- package/skinny/registerTextField.esm.js.map +1 -1
- package/skinny/registerTooltip.cjs.js +2 -2
- package/skinny/registerTooltip.cjs.js.map +1 -1
- package/skinny/registerTooltip.esm.js +1 -1
- package/skinny/utils-8dbb4d1f.cjs.js +79 -0
- package/skinny/utils-8dbb4d1f.cjs.js.map +1 -0
- package/skinny/utils-c7662a47.esm.js +69 -0
- package/skinny/utils-c7662a47.esm.js.map +1 -0
- package/dist/option-utils.d.ts +0 -42
- package/dist/registerHeader.d.ts +0 -5
- package/skinny/ErrorBoundary-c6b111d3.esm.js +0 -20
- package/skinny/ErrorBoundary-c6b111d3.esm.js.map +0 -1
- package/skinny/ErrorBoundary-e9b86248.cjs.js +0 -22
- package/skinny/ErrorBoundary-e9b86248.cjs.js.map +0 -1
- package/skinny/common-bfedaf7d.cjs.js.map +0 -1
- package/skinny/common-fa69e9b3.esm.js.map +0 -1
- package/skinny/contexts-0dec6156.cjs.js.map +0 -1
- package/skinny/contexts-9a8234bf.esm.js +0 -17
- package/skinny/contexts-9a8234bf.esm.js.map +0 -1
- package/skinny/interaction-variant-utils-36f1b397.cjs.js.map +0 -1
- package/skinny/interaction-variant-utils-abd0c319.esm.js.map +0 -1
- package/skinny/option-utils.d.ts +0 -42
- package/skinny/registerHeader.cjs.js +0 -55
- package/skinny/registerHeader.cjs.js.map +0 -1
- package/skinny/registerHeader.d.ts +0 -5
- package/skinny/registerHeader.esm.js +0 -48
- package/skinny/registerHeader.esm.js.map +0 -1
- package/skinny/registerListBox-b3f2891a.esm.js +0 -298
- package/skinny/registerListBox-b3f2891a.esm.js.map +0 -1
- package/skinny/registerListBox-f4801dbd.cjs.js +0 -310
- package/skinny/registerListBox-f4801dbd.cjs.js.map +0 -1
package/dist/react-aria.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
5
|
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
6
|
-
var i18n = require('@react-aria/i18n');
|
|
7
6
|
var reactAria = require('react-aria');
|
|
8
7
|
var utils = require('@react-aria/utils');
|
|
9
8
|
var host = require('@plasmicapp/host');
|
|
@@ -16,33 +15,35 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
16
15
|
var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
|
|
17
16
|
var flattenChildren__default = /*#__PURE__*/_interopDefault(flattenChildren);
|
|
18
17
|
|
|
19
|
-
var __defProp$
|
|
20
|
-
var __defProps$
|
|
21
|
-
var __getOwnPropDescs$
|
|
22
|
-
var __getOwnPropSymbols$
|
|
23
|
-
var __hasOwnProp$
|
|
24
|
-
var __propIsEnum$
|
|
25
|
-
var __defNormalProp$
|
|
26
|
-
var __spreadValues$
|
|
18
|
+
var __defProp$q = Object.defineProperty;
|
|
19
|
+
var __defProps$d = Object.defineProperties;
|
|
20
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
21
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
22
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
23
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
24
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
25
|
+
var __spreadValues$q = (a, b) => {
|
|
27
26
|
for (var prop in b || (b = {}))
|
|
28
|
-
if (__hasOwnProp$
|
|
29
|
-
__defNormalProp$
|
|
30
|
-
if (__getOwnPropSymbols$
|
|
31
|
-
for (var prop of __getOwnPropSymbols$
|
|
32
|
-
if (__propIsEnum$
|
|
33
|
-
__defNormalProp$
|
|
27
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
28
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
29
|
+
if (__getOwnPropSymbols$q)
|
|
30
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
31
|
+
if (__propIsEnum$q.call(b, prop))
|
|
32
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
34
33
|
}
|
|
35
34
|
return a;
|
|
36
35
|
};
|
|
37
|
-
var __spreadProps$
|
|
36
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
38
37
|
function registerComponentHelper(loader, component, meta, overrides) {
|
|
39
38
|
var _a;
|
|
40
|
-
meta = __spreadProps$
|
|
41
|
-
defaultStyles: __spreadValues$
|
|
39
|
+
meta = __spreadProps$d(__spreadValues$q({}, meta), {
|
|
40
|
+
defaultStyles: __spreadValues$q({
|
|
41
|
+
boxSizing: "border-box"
|
|
42
|
+
}, (_a = meta.defaultStyles) != null ? _a : {})
|
|
42
43
|
});
|
|
43
44
|
if (overrides) {
|
|
44
|
-
meta = __spreadProps$
|
|
45
|
-
props: __spreadValues$
|
|
45
|
+
meta = __spreadProps$d(__spreadValues$q(__spreadValues$q({}, meta), overrides), {
|
|
46
|
+
props: __spreadValues$q(__spreadValues$q({}, meta.props), overrides.props)
|
|
46
47
|
});
|
|
47
48
|
if (overrides.parentComponentName) {
|
|
48
49
|
meta.name = makeChildComponentName(
|
|
@@ -75,16 +76,10 @@ function extractPlasmicDataProps(props) {
|
|
|
75
76
|
Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
|
|
76
77
|
);
|
|
77
78
|
}
|
|
78
|
-
function withoutNils(array) {
|
|
79
|
-
return array.filter((x) => x != null);
|
|
80
|
-
}
|
|
81
79
|
function isDefined(thing) {
|
|
82
80
|
return thing !== void 0 && thing !== null;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
|
-
const defaultStyles = {
|
|
86
|
-
boxSizing: "border-box"
|
|
87
|
-
};
|
|
88
83
|
function hasParent(_props, ctx) {
|
|
89
84
|
return isDefined(ctx == null ? void 0 : ctx.parent) === true;
|
|
90
85
|
}
|
|
@@ -115,6 +110,7 @@ function createNameProp() {
|
|
|
115
110
|
return {
|
|
116
111
|
type: "string",
|
|
117
112
|
description: "Name for this field if it is part of a form",
|
|
113
|
+
displayName: "Form field key",
|
|
118
114
|
hidden: hasParent,
|
|
119
115
|
advanced: true
|
|
120
116
|
};
|
|
@@ -470,7 +466,7 @@ function ChangesObserver({
|
|
|
470
466
|
updateInteractionVariant(changes);
|
|
471
467
|
}
|
|
472
468
|
}, [changes, updateInteractionVariant]);
|
|
473
|
-
return children;
|
|
469
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, children);
|
|
474
470
|
}
|
|
475
471
|
function realWithObservedValues(children, changes, updateInteractionVariant) {
|
|
476
472
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
@@ -491,33 +487,33 @@ function pickAriaComponentVariants(keys) {
|
|
|
491
487
|
};
|
|
492
488
|
}
|
|
493
489
|
|
|
494
|
-
var __defProp$
|
|
495
|
-
var __defProps$
|
|
496
|
-
var __getOwnPropDescs$
|
|
497
|
-
var __getOwnPropSymbols$
|
|
498
|
-
var __hasOwnProp$
|
|
499
|
-
var __propIsEnum$
|
|
500
|
-
var __defNormalProp$
|
|
501
|
-
var __spreadValues$
|
|
490
|
+
var __defProp$p = Object.defineProperty;
|
|
491
|
+
var __defProps$c = Object.defineProperties;
|
|
492
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
493
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
494
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
495
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
496
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
497
|
+
var __spreadValues$p = (a, b) => {
|
|
502
498
|
for (var prop in b || (b = {}))
|
|
503
|
-
if (__hasOwnProp$
|
|
504
|
-
__defNormalProp$
|
|
505
|
-
if (__getOwnPropSymbols$
|
|
506
|
-
for (var prop of __getOwnPropSymbols$
|
|
507
|
-
if (__propIsEnum$
|
|
508
|
-
__defNormalProp$
|
|
499
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
500
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
501
|
+
if (__getOwnPropSymbols$p)
|
|
502
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
503
|
+
if (__propIsEnum$p.call(b, prop))
|
|
504
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
509
505
|
}
|
|
510
506
|
return a;
|
|
511
507
|
};
|
|
512
|
-
var __spreadProps$
|
|
513
|
-
var __objRest$
|
|
508
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
509
|
+
var __objRest$n = (source, exclude) => {
|
|
514
510
|
var target = {};
|
|
515
511
|
for (var prop in source)
|
|
516
|
-
if (__hasOwnProp$
|
|
512
|
+
if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
517
513
|
target[prop] = source[prop];
|
|
518
|
-
if (source != null && __getOwnPropSymbols$
|
|
519
|
-
for (var prop of __getOwnPropSymbols$
|
|
520
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
514
|
+
if (source != null && __getOwnPropSymbols$p)
|
|
515
|
+
for (var prop of __getOwnPropSymbols$p(source)) {
|
|
516
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
|
|
521
517
|
target[prop] = source[prop];
|
|
522
518
|
}
|
|
523
519
|
return target;
|
|
@@ -529,7 +525,7 @@ const BUTTON_INTERACTION_VARIANTS = [
|
|
|
529
525
|
"focusVisible",
|
|
530
526
|
"disabled"
|
|
531
527
|
];
|
|
532
|
-
const { interactionVariants: interactionVariants$
|
|
528
|
+
const { interactionVariants: interactionVariants$d, withObservedValues: withObservedValues$b } = pickAriaComponentVariants(
|
|
533
529
|
BUTTON_INTERACTION_VARIANTS
|
|
534
530
|
);
|
|
535
531
|
function BaseButton(props) {
|
|
@@ -538,14 +534,14 @@ function BaseButton(props) {
|
|
|
538
534
|
resetsForm,
|
|
539
535
|
children,
|
|
540
536
|
updateInteractionVariant
|
|
541
|
-
} = _a, rest = __objRest$
|
|
537
|
+
} = _a, rest = __objRest$n(_a, [
|
|
542
538
|
"submitsForm",
|
|
543
539
|
"resetsForm",
|
|
544
540
|
"children",
|
|
545
541
|
"updateInteractionVariant"
|
|
546
542
|
]);
|
|
547
543
|
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
548
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$
|
|
544
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$p({ type }, rest), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$b(
|
|
549
545
|
children,
|
|
550
546
|
{
|
|
551
547
|
hovered: isHovered,
|
|
@@ -567,7 +563,7 @@ function registerButton(loader, overrides) {
|
|
|
567
563
|
displayName: "Aria Button",
|
|
568
564
|
importPath: "@plasmicpkgs/react-aria/skinny/registerButton",
|
|
569
565
|
importName: "BaseButton",
|
|
570
|
-
interactionVariants: interactionVariants$
|
|
566
|
+
interactionVariants: interactionVariants$d,
|
|
571
567
|
defaultStyles: {
|
|
572
568
|
borderWidth: "1px",
|
|
573
569
|
borderStyle: "solid",
|
|
@@ -575,7 +571,8 @@ function registerButton(loader, overrides) {
|
|
|
575
571
|
padding: "2px 10px",
|
|
576
572
|
cursor: "pointer"
|
|
577
573
|
},
|
|
578
|
-
props: __spreadProps$
|
|
574
|
+
props: __spreadProps$c(__spreadValues$p({}, getCommonProps("button", [
|
|
575
|
+
"autoFocus",
|
|
579
576
|
"isDisabled",
|
|
580
577
|
"aria-label"
|
|
581
578
|
])), {
|
|
@@ -622,38 +619,36 @@ const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
|
622
619
|
React__default.default.createContext(void 0);
|
|
623
620
|
const PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
624
621
|
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
const PlasmicHeaderContext = React__default.default.createContext(void 0);
|
|
628
|
-
const PlasmicInputContext = React__default.default.createContext(void 0);
|
|
622
|
+
React__default.default.createContext(void 0);
|
|
623
|
+
React__default.default.createContext(void 0);
|
|
629
624
|
|
|
630
|
-
var __defProp$
|
|
631
|
-
var __defProps$
|
|
632
|
-
var __getOwnPropDescs$
|
|
633
|
-
var __getOwnPropSymbols$
|
|
634
|
-
var __hasOwnProp$
|
|
635
|
-
var __propIsEnum$
|
|
636
|
-
var __defNormalProp$
|
|
637
|
-
var __spreadValues$
|
|
625
|
+
var __defProp$o = Object.defineProperty;
|
|
626
|
+
var __defProps$b = Object.defineProperties;
|
|
627
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
628
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
629
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
630
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
631
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
632
|
+
var __spreadValues$o = (a, b) => {
|
|
638
633
|
for (var prop in b || (b = {}))
|
|
639
|
-
if (__hasOwnProp$
|
|
640
|
-
__defNormalProp$
|
|
641
|
-
if (__getOwnPropSymbols$
|
|
642
|
-
for (var prop of __getOwnPropSymbols$
|
|
643
|
-
if (__propIsEnum$
|
|
644
|
-
__defNormalProp$
|
|
634
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
635
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
636
|
+
if (__getOwnPropSymbols$o)
|
|
637
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
638
|
+
if (__propIsEnum$o.call(b, prop))
|
|
639
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
645
640
|
}
|
|
646
641
|
return a;
|
|
647
642
|
};
|
|
648
|
-
var __spreadProps$
|
|
649
|
-
var __objRest$
|
|
643
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
644
|
+
var __objRest$m = (source, exclude) => {
|
|
650
645
|
var target = {};
|
|
651
646
|
for (var prop in source)
|
|
652
|
-
if (__hasOwnProp$
|
|
647
|
+
if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
653
648
|
target[prop] = source[prop];
|
|
654
|
-
if (source != null && __getOwnPropSymbols$
|
|
655
|
-
for (var prop of __getOwnPropSymbols$
|
|
656
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
649
|
+
if (source != null && __getOwnPropSymbols$o)
|
|
650
|
+
for (var prop of __getOwnPropSymbols$o(source)) {
|
|
651
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
|
|
657
652
|
target[prop] = source[prop];
|
|
658
653
|
}
|
|
659
654
|
return target;
|
|
@@ -669,16 +664,16 @@ const CHECKBOX_INTERACTION_VARIANTS = [
|
|
|
669
664
|
"readonly",
|
|
670
665
|
"selected"
|
|
671
666
|
];
|
|
672
|
-
const { interactionVariants: interactionVariants$
|
|
667
|
+
const { interactionVariants: interactionVariants$c, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
|
|
673
668
|
CHECKBOX_INTERACTION_VARIANTS
|
|
674
669
|
);
|
|
675
670
|
function BaseCheckbox(props) {
|
|
676
|
-
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$
|
|
671
|
+
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$m(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
|
|
677
672
|
const contextProps = React__default.default.useContext(PlasmicCheckboxGroupContext);
|
|
678
673
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
679
674
|
parent: contextProps
|
|
680
675
|
});
|
|
681
|
-
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$
|
|
676
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$o({}, rest), ({
|
|
682
677
|
isHovered,
|
|
683
678
|
isPressed,
|
|
684
679
|
isFocused,
|
|
@@ -687,7 +682,7 @@ function BaseCheckbox(props) {
|
|
|
687
682
|
isIndeterminate,
|
|
688
683
|
isSelected,
|
|
689
684
|
isReadOnly
|
|
690
|
-
}) => withObservedValues$
|
|
685
|
+
}) => withObservedValues$a(
|
|
691
686
|
children,
|
|
692
687
|
{
|
|
693
688
|
hovered: isHovered,
|
|
@@ -757,8 +752,8 @@ function registerCheckbox(loader, overrides) {
|
|
|
757
752
|
displayName: "Aria Checkbox",
|
|
758
753
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
759
754
|
importName: "BaseCheckbox",
|
|
760
|
-
interactionVariants: interactionVariants$
|
|
761
|
-
props: __spreadProps$
|
|
755
|
+
interactionVariants: interactionVariants$c,
|
|
756
|
+
props: __spreadProps$b(__spreadValues$o({}, getCommonProps("checkbox", [
|
|
762
757
|
"name",
|
|
763
758
|
"isDisabled",
|
|
764
759
|
"isReadOnly",
|
|
@@ -826,37 +821,37 @@ function registerCheckbox(loader, overrides) {
|
|
|
826
821
|
);
|
|
827
822
|
}
|
|
828
823
|
|
|
829
|
-
var __defProp$
|
|
830
|
-
var __getOwnPropSymbols$
|
|
831
|
-
var __hasOwnProp$
|
|
832
|
-
var __propIsEnum$
|
|
833
|
-
var __defNormalProp$
|
|
834
|
-
var __spreadValues$
|
|
824
|
+
var __defProp$n = Object.defineProperty;
|
|
825
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
826
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
827
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
828
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
829
|
+
var __spreadValues$n = (a, b) => {
|
|
835
830
|
for (var prop in b || (b = {}))
|
|
836
|
-
if (__hasOwnProp$
|
|
837
|
-
__defNormalProp$
|
|
838
|
-
if (__getOwnPropSymbols$
|
|
839
|
-
for (var prop of __getOwnPropSymbols$
|
|
840
|
-
if (__propIsEnum$
|
|
841
|
-
__defNormalProp$
|
|
831
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
832
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
833
|
+
if (__getOwnPropSymbols$n)
|
|
834
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
835
|
+
if (__propIsEnum$n.call(b, prop))
|
|
836
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
842
837
|
}
|
|
843
838
|
return a;
|
|
844
839
|
};
|
|
845
|
-
var __objRest$
|
|
840
|
+
var __objRest$l = (source, exclude) => {
|
|
846
841
|
var target = {};
|
|
847
842
|
for (var prop in source)
|
|
848
|
-
if (__hasOwnProp$
|
|
843
|
+
if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
849
844
|
target[prop] = source[prop];
|
|
850
|
-
if (source != null && __getOwnPropSymbols$
|
|
851
|
-
for (var prop of __getOwnPropSymbols$
|
|
852
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
845
|
+
if (source != null && __getOwnPropSymbols$n)
|
|
846
|
+
for (var prop of __getOwnPropSymbols$n(source)) {
|
|
847
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
|
|
853
848
|
target[prop] = source[prop];
|
|
854
849
|
}
|
|
855
850
|
return target;
|
|
856
851
|
};
|
|
857
852
|
function BaseText(_a) {
|
|
858
|
-
var _b = _a, { children } = _b, rest = __objRest$
|
|
859
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$
|
|
853
|
+
var _b = _a, { children } = _b, rest = __objRest$l(_b, ["children"]);
|
|
854
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$n({}, rest), children);
|
|
860
855
|
}
|
|
861
856
|
const TEXT_COMPONENT_NAME = makeComponentName("text");
|
|
862
857
|
function registerText(loader, overrides) {
|
|
@@ -890,28 +885,28 @@ function registerText(loader, overrides) {
|
|
|
890
885
|
);
|
|
891
886
|
}
|
|
892
887
|
|
|
893
|
-
var __defProp$
|
|
894
|
-
var __defProps$
|
|
895
|
-
var __getOwnPropDescs$
|
|
896
|
-
var __getOwnPropSymbols$
|
|
897
|
-
var __hasOwnProp$
|
|
898
|
-
var __propIsEnum$
|
|
899
|
-
var __defNormalProp$
|
|
900
|
-
var __spreadValues$
|
|
888
|
+
var __defProp$m = Object.defineProperty;
|
|
889
|
+
var __defProps$a = Object.defineProperties;
|
|
890
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
891
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
892
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
893
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
894
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
895
|
+
var __spreadValues$m = (a, b) => {
|
|
901
896
|
for (var prop in b || (b = {}))
|
|
902
|
-
if (__hasOwnProp$
|
|
903
|
-
__defNormalProp$
|
|
904
|
-
if (__getOwnPropSymbols$
|
|
905
|
-
for (var prop of __getOwnPropSymbols$
|
|
906
|
-
if (__propIsEnum$
|
|
907
|
-
__defNormalProp$
|
|
897
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
898
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
899
|
+
if (__getOwnPropSymbols$m)
|
|
900
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
901
|
+
if (__propIsEnum$m.call(b, prop))
|
|
902
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
908
903
|
}
|
|
909
904
|
return a;
|
|
910
905
|
};
|
|
911
|
-
var __spreadProps$
|
|
906
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
912
907
|
const DESCRIPTION_COMPONENT_NAME = makeComponentName("description");
|
|
913
908
|
function registerDescription(loader, overrides) {
|
|
914
|
-
return registerText(loader, __spreadProps$
|
|
909
|
+
return registerText(loader, __spreadProps$a(__spreadValues$m({}, overrides), {
|
|
915
910
|
name: DESCRIPTION_COMPONENT_NAME,
|
|
916
911
|
displayName: "Aria Description",
|
|
917
912
|
props: {
|
|
@@ -924,30 +919,30 @@ function registerDescription(loader, overrides) {
|
|
|
924
919
|
}));
|
|
925
920
|
}
|
|
926
921
|
|
|
927
|
-
var __defProp$
|
|
928
|
-
var __getOwnPropSymbols$
|
|
929
|
-
var __hasOwnProp$
|
|
930
|
-
var __propIsEnum$
|
|
931
|
-
var __defNormalProp$
|
|
932
|
-
var __spreadValues$
|
|
922
|
+
var __defProp$l = Object.defineProperty;
|
|
923
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
924
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
925
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
926
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
927
|
+
var __spreadValues$l = (a, b) => {
|
|
933
928
|
for (var prop in b || (b = {}))
|
|
934
|
-
if (__hasOwnProp$
|
|
935
|
-
__defNormalProp$
|
|
936
|
-
if (__getOwnPropSymbols$
|
|
937
|
-
for (var prop of __getOwnPropSymbols$
|
|
938
|
-
if (__propIsEnum$
|
|
939
|
-
__defNormalProp$
|
|
929
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
930
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
931
|
+
if (__getOwnPropSymbols$l)
|
|
932
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
933
|
+
if (__propIsEnum$l.call(b, prop))
|
|
934
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
940
935
|
}
|
|
941
936
|
return a;
|
|
942
937
|
};
|
|
943
|
-
var __objRest$
|
|
938
|
+
var __objRest$k = (source, exclude) => {
|
|
944
939
|
var target = {};
|
|
945
940
|
for (var prop in source)
|
|
946
|
-
if (__hasOwnProp$
|
|
941
|
+
if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
947
942
|
target[prop] = source[prop];
|
|
948
|
-
if (source != null && __getOwnPropSymbols$
|
|
949
|
-
for (var prop of __getOwnPropSymbols$
|
|
950
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
943
|
+
if (source != null && __getOwnPropSymbols$l)
|
|
944
|
+
for (var prop of __getOwnPropSymbols$l(source)) {
|
|
945
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
|
|
951
946
|
target[prop] = source[prop];
|
|
952
947
|
}
|
|
953
948
|
return target;
|
|
@@ -964,7 +959,7 @@ function BaseFieldError(_a) {
|
|
|
964
959
|
tooShort,
|
|
965
960
|
typeMismatch,
|
|
966
961
|
valueMissing
|
|
967
|
-
} = _b, rest = __objRest$
|
|
962
|
+
} = _b, rest = __objRest$k(_b, [
|
|
968
963
|
"badInput",
|
|
969
964
|
"customError",
|
|
970
965
|
"patternMismatch",
|
|
@@ -976,7 +971,7 @@ function BaseFieldError(_a) {
|
|
|
976
971
|
"typeMismatch",
|
|
977
972
|
"valueMissing"
|
|
978
973
|
]);
|
|
979
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$
|
|
974
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$l({}, rest), ({ validationDetails, validationErrors }) => {
|
|
980
975
|
if (validationDetails.badInput && badInput) {
|
|
981
976
|
return badInput;
|
|
982
977
|
}
|
|
@@ -1108,33 +1103,33 @@ function registerLabel(loader, overrides) {
|
|
|
1108
1103
|
);
|
|
1109
1104
|
}
|
|
1110
1105
|
|
|
1111
|
-
var __defProp$
|
|
1112
|
-
var __defProps$
|
|
1113
|
-
var __getOwnPropDescs$
|
|
1114
|
-
var __getOwnPropSymbols$
|
|
1115
|
-
var __hasOwnProp$
|
|
1116
|
-
var __propIsEnum$
|
|
1117
|
-
var __defNormalProp$
|
|
1118
|
-
var __spreadValues$
|
|
1106
|
+
var __defProp$k = Object.defineProperty;
|
|
1107
|
+
var __defProps$9 = Object.defineProperties;
|
|
1108
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
1109
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
1110
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
1111
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
1112
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1113
|
+
var __spreadValues$k = (a, b) => {
|
|
1119
1114
|
for (var prop in b || (b = {}))
|
|
1120
|
-
if (__hasOwnProp$
|
|
1121
|
-
__defNormalProp$
|
|
1122
|
-
if (__getOwnPropSymbols$
|
|
1123
|
-
for (var prop of __getOwnPropSymbols$
|
|
1124
|
-
if (__propIsEnum$
|
|
1125
|
-
__defNormalProp$
|
|
1115
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
1116
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
1117
|
+
if (__getOwnPropSymbols$k)
|
|
1118
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
1119
|
+
if (__propIsEnum$k.call(b, prop))
|
|
1120
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
1126
1121
|
}
|
|
1127
1122
|
return a;
|
|
1128
1123
|
};
|
|
1129
|
-
var __spreadProps$
|
|
1130
|
-
var __objRest$
|
|
1124
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
1125
|
+
var __objRest$j = (source, exclude) => {
|
|
1131
1126
|
var target = {};
|
|
1132
1127
|
for (var prop in source)
|
|
1133
|
-
if (__hasOwnProp$
|
|
1128
|
+
if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1134
1129
|
target[prop] = source[prop];
|
|
1135
|
-
if (source != null && __getOwnPropSymbols$
|
|
1136
|
-
for (var prop of __getOwnPropSymbols$
|
|
1137
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1130
|
+
if (source != null && __getOwnPropSymbols$k)
|
|
1131
|
+
for (var prop of __getOwnPropSymbols$k(source)) {
|
|
1132
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
|
|
1138
1133
|
target[prop] = source[prop];
|
|
1139
1134
|
}
|
|
1140
1135
|
return target;
|
|
@@ -1143,12 +1138,12 @@ const CHECKBOX_GROUP_INTERACTION_VARIANTS = [
|
|
|
1143
1138
|
"disabled",
|
|
1144
1139
|
"readonly"
|
|
1145
1140
|
];
|
|
1146
|
-
const { interactionVariants: interactionVariants$
|
|
1141
|
+
const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
|
|
1147
1142
|
CHECKBOX_GROUP_INTERACTION_VARIANTS
|
|
1148
1143
|
);
|
|
1149
1144
|
function BaseCheckboxGroup(props) {
|
|
1150
|
-
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$
|
|
1151
|
-
return /* @__PURE__ */ React__default.default.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.CheckboxGroup, __spreadValues$
|
|
1145
|
+
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant"]);
|
|
1146
|
+
return /* @__PURE__ */ React__default.default.createElement(PlasmicCheckboxGroupContext.Provider, { value: rest }, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.CheckboxGroup, __spreadValues$k({}, rest), ({ isDisabled, isReadOnly }) => withObservedValues$9(
|
|
1152
1147
|
children,
|
|
1153
1148
|
{
|
|
1154
1149
|
disabled: isDisabled,
|
|
@@ -1176,8 +1171,8 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
1176
1171
|
displayName: "Aria Checkbox Group",
|
|
1177
1172
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
|
|
1178
1173
|
importName: "BaseCheckboxGroup",
|
|
1179
|
-
interactionVariants: interactionVariants$
|
|
1180
|
-
props: __spreadProps$
|
|
1174
|
+
interactionVariants: interactionVariants$b,
|
|
1175
|
+
props: __spreadProps$9(__spreadValues$k({}, getCommonProps("checkbox group", [
|
|
1181
1176
|
"name",
|
|
1182
1177
|
"isDisabled",
|
|
1183
1178
|
"isReadOnly",
|
|
@@ -1292,195 +1287,80 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
1292
1287
|
);
|
|
1293
1288
|
}
|
|
1294
1289
|
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
let sectionCount = 0;
|
|
1305
|
-
const makeStrict = (op) => {
|
|
1306
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
1307
|
-
if (!op) {
|
|
1308
|
-
return void 0;
|
|
1309
|
-
} else if (typeof op === "string" || typeof op === "number") {
|
|
1310
|
-
const item = {
|
|
1311
|
-
id: op
|
|
1312
|
-
};
|
|
1313
|
-
return item;
|
|
1314
|
-
} else if (optionInfo) {
|
|
1315
|
-
const info = optionInfo(op);
|
|
1316
|
-
if (info.type === "option-group") {
|
|
1317
|
-
const section = {
|
|
1318
|
-
type: "option-group",
|
|
1319
|
-
items: (_c = (_b = (_a2 = info.items) == null ? void 0 : _a2.map) == null ? void 0 : _b.call(_a2, (item) => makeStrict(item))) == null ? void 0 : _c.filter((x) => !!x),
|
|
1320
|
-
label: info.label,
|
|
1321
|
-
key: `option-group-${sectionCount}`
|
|
1322
|
-
};
|
|
1323
|
-
sectionCount += 1;
|
|
1324
|
-
return section;
|
|
1325
|
-
} else {
|
|
1326
|
-
let item = info;
|
|
1327
|
-
if (!("id" in item)) {
|
|
1328
|
-
item = {
|
|
1329
|
-
type: "option",
|
|
1330
|
-
id: JSON.stringify(item)
|
|
1331
|
-
};
|
|
1332
|
-
}
|
|
1333
|
-
return item;
|
|
1334
|
-
}
|
|
1335
|
-
} else if (typeof op === "object") {
|
|
1336
|
-
if ("items" in op) {
|
|
1337
|
-
const section = {
|
|
1338
|
-
type: "option-group",
|
|
1339
|
-
items: (_f = (_e = (_d = op.items) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (item) => makeStrict(item))) == null ? void 0 : _f.filter((x) => !!x),
|
|
1340
|
-
label: op.label,
|
|
1341
|
-
key: `option-group-${sectionCount}`
|
|
1342
|
-
};
|
|
1343
|
-
sectionCount += 1;
|
|
1344
|
-
return section;
|
|
1345
|
-
} else {
|
|
1346
|
-
let item = op;
|
|
1347
|
-
if (!("id" in item)) {
|
|
1348
|
-
item = {
|
|
1349
|
-
type: "option",
|
|
1350
|
-
id: JSON.stringify(item)
|
|
1351
|
-
};
|
|
1352
|
-
}
|
|
1353
|
-
return item;
|
|
1354
|
-
}
|
|
1290
|
+
class ListBoxItemIdManager {
|
|
1291
|
+
constructor() {
|
|
1292
|
+
this._ids = /* @__PURE__ */ new Set();
|
|
1293
|
+
this._observers = /* @__PURE__ */ new Set();
|
|
1294
|
+
}
|
|
1295
|
+
generateDuplicateId(id, count = 1) {
|
|
1296
|
+
const dupId = `${id} duplicate(${count})`;
|
|
1297
|
+
if (this._ids.has(dupId)) {
|
|
1298
|
+
return this.generateDuplicateId(id, count + 1);
|
|
1355
1299
|
} else {
|
|
1356
|
-
return
|
|
1300
|
+
return dupId;
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
generateMissingId(count = 1) {
|
|
1304
|
+
const missingId = `missing(${count})`;
|
|
1305
|
+
if (this._ids.has(missingId)) {
|
|
1306
|
+
return this.generateMissingId(count + 1);
|
|
1307
|
+
} else {
|
|
1308
|
+
return missingId;
|
|
1357
1309
|
}
|
|
1358
|
-
};
|
|
1359
|
-
const strictOptions = (_a = options == null ? void 0 : options.map(makeStrict)) == null ? void 0 : _a.filter((x) => !!x);
|
|
1360
|
-
const optionText = (op) => {
|
|
1361
|
-
var _a2;
|
|
1362
|
-
return (_a2 = op.label) != null ? _a2 : op.id;
|
|
1363
|
-
};
|
|
1364
|
-
return { options: strictOptions, optionText };
|
|
1365
|
-
}
|
|
1366
|
-
function flattenOptions(options) {
|
|
1367
|
-
if (!options) {
|
|
1368
|
-
return [];
|
|
1369
|
-
} else {
|
|
1370
|
-
return options.flatMap(
|
|
1371
|
-
(op) => {
|
|
1372
|
-
var _a;
|
|
1373
|
-
return op.type === "option-group" ? (_a = op.items) != null ? _a : [] : op;
|
|
1374
|
-
}
|
|
1375
|
-
);
|
|
1376
1310
|
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
itemType: {
|
|
1405
|
-
type: "object",
|
|
1406
|
-
nameFunc: (item) => item.label || item.id,
|
|
1407
|
-
fields: {
|
|
1408
|
-
id: "string",
|
|
1409
|
-
label: "string"
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
}
|
|
1414
|
-
},
|
|
1415
|
-
defaultValue: [
|
|
1416
|
-
{
|
|
1417
|
-
id: "option1",
|
|
1418
|
-
label: "Option 1",
|
|
1419
|
-
type: "option"
|
|
1420
|
-
},
|
|
1421
|
-
{
|
|
1422
|
-
id: "option2",
|
|
1423
|
-
label: "Option 2",
|
|
1424
|
-
type: "option"
|
|
1425
|
-
},
|
|
1426
|
-
{
|
|
1427
|
-
label: "Section 1",
|
|
1428
|
-
type: "option-group",
|
|
1429
|
-
items: [
|
|
1430
|
-
{
|
|
1431
|
-
id: "section-1-1",
|
|
1432
|
-
label: "Section item 1",
|
|
1433
|
-
type: "option"
|
|
1434
|
-
},
|
|
1435
|
-
{
|
|
1436
|
-
id: "section-1-2",
|
|
1437
|
-
label: "Section item 2",
|
|
1438
|
-
type: "option"
|
|
1439
|
-
}
|
|
1440
|
-
]
|
|
1441
|
-
}
|
|
1442
|
-
]
|
|
1443
|
-
};
|
|
1444
|
-
return type;
|
|
1445
|
-
}
|
|
1446
|
-
function makeValuePropType() {
|
|
1447
|
-
const type = {
|
|
1448
|
-
type: "choice",
|
|
1449
|
-
options: (ps) => {
|
|
1450
|
-
const { options, optionText } = deriveStrictOptions(ps);
|
|
1451
|
-
return flattenOptions(options).map((op) => ({
|
|
1452
|
-
value: op.id,
|
|
1453
|
-
label: optionText(op)
|
|
1454
|
-
}));
|
|
1455
|
-
}
|
|
1456
|
-
};
|
|
1457
|
-
return type;
|
|
1311
|
+
register(id) {
|
|
1312
|
+
let newId;
|
|
1313
|
+
if (!id) {
|
|
1314
|
+
newId = this.generateMissingId();
|
|
1315
|
+
} else if (this._ids.has(id)) {
|
|
1316
|
+
newId = this.generateDuplicateId(id);
|
|
1317
|
+
} else {
|
|
1318
|
+
newId = id;
|
|
1319
|
+
}
|
|
1320
|
+
this._ids.add(newId);
|
|
1321
|
+
this.notify();
|
|
1322
|
+
return newId;
|
|
1323
|
+
}
|
|
1324
|
+
unregister(id) {
|
|
1325
|
+
this._ids.delete(id);
|
|
1326
|
+
this.notify();
|
|
1327
|
+
}
|
|
1328
|
+
subscribe(observer) {
|
|
1329
|
+
this._observers.add(observer);
|
|
1330
|
+
}
|
|
1331
|
+
// Notify all observers about an event.
|
|
1332
|
+
notify() {
|
|
1333
|
+
this._observers.forEach((observer) => observer(this.ids));
|
|
1334
|
+
}
|
|
1335
|
+
get ids() {
|
|
1336
|
+
return Array.from(this._ids);
|
|
1337
|
+
}
|
|
1458
1338
|
}
|
|
1459
1339
|
|
|
1460
|
-
var __defProp$
|
|
1461
|
-
var __getOwnPropSymbols$
|
|
1462
|
-
var __hasOwnProp$
|
|
1463
|
-
var __propIsEnum$
|
|
1464
|
-
var __defNormalProp$
|
|
1465
|
-
var __spreadValues$
|
|
1340
|
+
var __defProp$j = Object.defineProperty;
|
|
1341
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
1342
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
1343
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
1344
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1345
|
+
var __spreadValues$j = (a, b) => {
|
|
1466
1346
|
for (var prop in b || (b = {}))
|
|
1467
|
-
if (__hasOwnProp$
|
|
1468
|
-
__defNormalProp$
|
|
1469
|
-
if (__getOwnPropSymbols$
|
|
1470
|
-
for (var prop of __getOwnPropSymbols$
|
|
1471
|
-
if (__propIsEnum$
|
|
1472
|
-
__defNormalProp$
|
|
1347
|
+
if (__hasOwnProp$j.call(b, prop))
|
|
1348
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1349
|
+
if (__getOwnPropSymbols$j)
|
|
1350
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
|
1351
|
+
if (__propIsEnum$j.call(b, prop))
|
|
1352
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1473
1353
|
}
|
|
1474
1354
|
return a;
|
|
1475
1355
|
};
|
|
1476
|
-
var __objRest$
|
|
1356
|
+
var __objRest$i = (source, exclude) => {
|
|
1477
1357
|
var target = {};
|
|
1478
1358
|
for (var prop in source)
|
|
1479
|
-
if (__hasOwnProp$
|
|
1359
|
+
if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1480
1360
|
target[prop] = source[prop];
|
|
1481
|
-
if (source != null && __getOwnPropSymbols$
|
|
1482
|
-
for (var prop of __getOwnPropSymbols$
|
|
1483
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1361
|
+
if (source != null && __getOwnPropSymbols$j)
|
|
1362
|
+
for (var prop of __getOwnPropSymbols$j(source)) {
|
|
1363
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
|
|
1484
1364
|
target[prop] = source[prop];
|
|
1485
1365
|
}
|
|
1486
1366
|
return target;
|
|
@@ -1490,7 +1370,7 @@ const INPUT_INTERACTION_VARIANTS = [
|
|
|
1490
1370
|
"hovered",
|
|
1491
1371
|
"disabled"
|
|
1492
1372
|
];
|
|
1493
|
-
const { interactionVariants: interactionVariants$
|
|
1373
|
+
const { interactionVariants: interactionVariants$a } = pickAriaComponentVariants(
|
|
1494
1374
|
INPUT_INTERACTION_VARIANTS
|
|
1495
1375
|
);
|
|
1496
1376
|
const inputHelpers$1 = {
|
|
@@ -1509,7 +1389,7 @@ function BaseInput(props) {
|
|
|
1509
1389
|
setControlContextData,
|
|
1510
1390
|
disabled,
|
|
1511
1391
|
autoComplete
|
|
1512
|
-
} = _a, rest = __objRest$
|
|
1392
|
+
} = _a, rest = __objRest$i(_a, [
|
|
1513
1393
|
"updateInteractionVariant",
|
|
1514
1394
|
"setControlContextData",
|
|
1515
1395
|
"disabled",
|
|
@@ -1534,7 +1414,7 @@ function BaseInput(props) {
|
|
|
1534
1414
|
}, [mergedProps.disabled, updateInteractionVariant]);
|
|
1535
1415
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
1536
1416
|
reactAriaComponents.Input,
|
|
1537
|
-
__spreadValues$
|
|
1417
|
+
__spreadValues$j({
|
|
1538
1418
|
autoComplete: resolveAutoComplete(autoComplete),
|
|
1539
1419
|
onHoverChange: (isHovered) => {
|
|
1540
1420
|
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
@@ -1564,15 +1444,15 @@ function registerInput(loader, overrides) {
|
|
|
1564
1444
|
displayName: "Aria Input",
|
|
1565
1445
|
importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
|
|
1566
1446
|
importName: "BaseInput",
|
|
1567
|
-
interactionVariants: interactionVariants$
|
|
1447
|
+
interactionVariants: interactionVariants$a,
|
|
1568
1448
|
defaultStyles: {
|
|
1569
1449
|
width: "300px",
|
|
1570
1450
|
borderWidth: "1px",
|
|
1571
1451
|
borderStyle: "solid",
|
|
1572
1452
|
borderColor: "black",
|
|
1573
|
-
padding: "
|
|
1453
|
+
padding: "4px 10px"
|
|
1574
1454
|
},
|
|
1575
|
-
props: __spreadValues$
|
|
1455
|
+
props: __spreadValues$j({}, getCommonProps("Input", [
|
|
1576
1456
|
"name",
|
|
1577
1457
|
"disabled",
|
|
1578
1458
|
"readOnly",
|
|
@@ -1603,7 +1483,7 @@ function registerInput(loader, overrides) {
|
|
|
1603
1483
|
"onInput"
|
|
1604
1484
|
])),
|
|
1605
1485
|
states: {
|
|
1606
|
-
value: __spreadValues$
|
|
1486
|
+
value: __spreadValues$j({
|
|
1607
1487
|
type: "writable",
|
|
1608
1488
|
valueProp: "value",
|
|
1609
1489
|
onChangeProp: "onChange",
|
|
@@ -1621,46 +1501,98 @@ function registerInput(loader, overrides) {
|
|
|
1621
1501
|
);
|
|
1622
1502
|
}
|
|
1623
1503
|
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
return { hasError: true };
|
|
1631
|
-
}
|
|
1632
|
-
render() {
|
|
1633
|
-
if (this.state.hasError) {
|
|
1634
|
-
return this.props.fallback;
|
|
1635
|
-
}
|
|
1636
|
-
return this.props.children;
|
|
1637
|
-
}
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
var __defProp$j = Object.defineProperty;
|
|
1641
|
-
var __defProps$9 = Object.defineProperties;
|
|
1642
|
-
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
1643
|
-
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
1644
|
-
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
1645
|
-
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
1646
|
-
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1647
|
-
var __spreadValues$j = (a, b) => {
|
|
1504
|
+
var __defProp$i = Object.defineProperty;
|
|
1505
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
1506
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
1507
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
1508
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1509
|
+
var __spreadValues$i = (a, b) => {
|
|
1648
1510
|
for (var prop in b || (b = {}))
|
|
1649
|
-
if (__hasOwnProp$
|
|
1650
|
-
__defNormalProp$
|
|
1651
|
-
if (__getOwnPropSymbols$
|
|
1652
|
-
for (var prop of __getOwnPropSymbols$
|
|
1653
|
-
if (__propIsEnum$
|
|
1654
|
-
__defNormalProp$
|
|
1511
|
+
if (__hasOwnProp$i.call(b, prop))
|
|
1512
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1513
|
+
if (__getOwnPropSymbols$i)
|
|
1514
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
1515
|
+
if (__propIsEnum$i.call(b, prop))
|
|
1516
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1655
1517
|
}
|
|
1656
1518
|
return a;
|
|
1657
1519
|
};
|
|
1658
|
-
var
|
|
1520
|
+
var __objRest$h = (source, exclude) => {
|
|
1521
|
+
var target = {};
|
|
1522
|
+
for (var prop in source)
|
|
1523
|
+
if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1524
|
+
target[prop] = source[prop];
|
|
1525
|
+
if (source != null && __getOwnPropSymbols$i)
|
|
1526
|
+
for (var prop of __getOwnPropSymbols$i(source)) {
|
|
1527
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
|
|
1528
|
+
target[prop] = source[prop];
|
|
1529
|
+
}
|
|
1530
|
+
return target;
|
|
1531
|
+
};
|
|
1532
|
+
const LIST_BOX_ITEM_INTERACTION_VARIANTS = [
|
|
1533
|
+
"hovered",
|
|
1534
|
+
"pressed",
|
|
1535
|
+
"focused",
|
|
1536
|
+
"focusVisible",
|
|
1537
|
+
"selected",
|
|
1538
|
+
"disabled"
|
|
1539
|
+
];
|
|
1540
|
+
const { interactionVariants: interactionVariants$9, withObservedValues: withObservedValues$8 } = pickAriaComponentVariants(
|
|
1541
|
+
LIST_BOX_ITEM_INTERACTION_VARIANTS
|
|
1542
|
+
);
|
|
1659
1543
|
function BaseListBoxItem(props) {
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1544
|
+
const _a = props, {
|
|
1545
|
+
children,
|
|
1546
|
+
setControlContextData,
|
|
1547
|
+
updateInteractionVariant,
|
|
1548
|
+
id
|
|
1549
|
+
} = _a, rest = __objRest$h(_a, [
|
|
1550
|
+
"children",
|
|
1551
|
+
"setControlContextData",
|
|
1552
|
+
"updateInteractionVariant",
|
|
1553
|
+
"id"
|
|
1554
|
+
]);
|
|
1555
|
+
const listboxContext = React__default.default.useContext(PlasmicListBoxContext);
|
|
1556
|
+
const isStandalone = !listboxContext;
|
|
1557
|
+
const [registeredId, setRegisteredId] = React.useState();
|
|
1558
|
+
React.useEffect(() => {
|
|
1559
|
+
if (!listboxContext) {
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1562
|
+
const localId = listboxContext.idManager.register(id);
|
|
1563
|
+
setRegisteredId(localId);
|
|
1564
|
+
return () => {
|
|
1565
|
+
listboxContext.idManager.unregister(localId);
|
|
1566
|
+
setRegisteredId(void 0);
|
|
1567
|
+
};
|
|
1568
|
+
}, [id]);
|
|
1569
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1570
|
+
// this means that a unique id was registered, different from the provided id
|
|
1571
|
+
hasDuplicateId: !isStandalone && id !== registeredId
|
|
1572
|
+
});
|
|
1573
|
+
const listboxItem = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues$i({ key: registeredId, id: registeredId }, rest), ({
|
|
1574
|
+
isHovered,
|
|
1575
|
+
isPressed,
|
|
1576
|
+
isFocused,
|
|
1577
|
+
isFocusVisible,
|
|
1578
|
+
isSelected,
|
|
1579
|
+
isDisabled
|
|
1580
|
+
}) => withObservedValues$8(
|
|
1581
|
+
children,
|
|
1582
|
+
{
|
|
1583
|
+
hovered: isHovered,
|
|
1584
|
+
pressed: isPressed,
|
|
1585
|
+
focused: isFocused,
|
|
1586
|
+
focusVisible: isFocusVisible,
|
|
1587
|
+
selected: isSelected,
|
|
1588
|
+
disabled: isDisabled
|
|
1589
|
+
},
|
|
1590
|
+
updateInteractionVariant
|
|
1591
|
+
));
|
|
1592
|
+
if (isStandalone) {
|
|
1593
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, { selectionMode: "single" }, listboxItem);
|
|
1594
|
+
}
|
|
1595
|
+
return listboxItem;
|
|
1664
1596
|
}
|
|
1665
1597
|
const makeDefaultListBoxItemChildren = (label, description) => ({
|
|
1666
1598
|
type: "vbox",
|
|
@@ -1708,7 +1640,23 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1708
1640
|
displayName: "Aria ListBoxItem",
|
|
1709
1641
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
1710
1642
|
importName: "BaseListBoxItem",
|
|
1643
|
+
interactionVariants: interactionVariants$9,
|
|
1711
1644
|
props: {
|
|
1645
|
+
id: {
|
|
1646
|
+
type: "string",
|
|
1647
|
+
description: "The id of the item",
|
|
1648
|
+
required: true,
|
|
1649
|
+
validator: (_value, _props, ctx) => {
|
|
1650
|
+
if (ctx == null ? void 0 : ctx.hasDuplicateId) {
|
|
1651
|
+
return "Please make sure the id is unique!";
|
|
1652
|
+
}
|
|
1653
|
+
return true;
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
textValue: {
|
|
1657
|
+
type: "string",
|
|
1658
|
+
description: "A text representation of the item's contents, used for features like typeahead."
|
|
1659
|
+
},
|
|
1712
1660
|
children: {
|
|
1713
1661
|
type: "slot",
|
|
1714
1662
|
defaultValue: makeDefaultListBoxItemChildren("Item")
|
|
@@ -1719,45 +1667,6 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1719
1667
|
);
|
|
1720
1668
|
}
|
|
1721
1669
|
|
|
1722
|
-
var __defProp$i = Object.defineProperty;
|
|
1723
|
-
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
1724
|
-
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
1725
|
-
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
1726
|
-
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1727
|
-
var __spreadValues$i = (a, b) => {
|
|
1728
|
-
for (var prop in b || (b = {}))
|
|
1729
|
-
if (__hasOwnProp$i.call(b, prop))
|
|
1730
|
-
__defNormalProp$i(a, prop, b[prop]);
|
|
1731
|
-
if (__getOwnPropSymbols$i)
|
|
1732
|
-
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
1733
|
-
if (__propIsEnum$i.call(b, prop))
|
|
1734
|
-
__defNormalProp$i(a, prop, b[prop]);
|
|
1735
|
-
}
|
|
1736
|
-
return a;
|
|
1737
|
-
};
|
|
1738
|
-
function BaseHeader(props) {
|
|
1739
|
-
const contextProps = React__default.default.useContext(PlasmicHeaderContext);
|
|
1740
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, __spreadValues$i({}, utils.mergeProps(contextProps, props)));
|
|
1741
|
-
}
|
|
1742
|
-
function registerHeader(loader, overrides) {
|
|
1743
|
-
return registerComponentHelper(
|
|
1744
|
-
loader,
|
|
1745
|
-
BaseHeader,
|
|
1746
|
-
{
|
|
1747
|
-
name: makeComponentName("header"),
|
|
1748
|
-
displayName: "Aria Header",
|
|
1749
|
-
importPath: "@plasmicpkgs/react-aria/skinny/registerHeader",
|
|
1750
|
-
importName: "BaseHeader",
|
|
1751
|
-
defaultStyles: {
|
|
1752
|
-
fontWeight: "bold",
|
|
1753
|
-
fontSize: "20px"
|
|
1754
|
-
},
|
|
1755
|
-
props: {}
|
|
1756
|
-
},
|
|
1757
|
-
overrides
|
|
1758
|
-
);
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
1670
|
var __defProp$h = Object.defineProperty;
|
|
1762
1671
|
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
1763
1672
|
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
|
@@ -1774,22 +1683,25 @@ var __spreadValues$h = (a, b) => {
|
|
|
1774
1683
|
}
|
|
1775
1684
|
return a;
|
|
1776
1685
|
};
|
|
1686
|
+
var __objRest$g = (source, exclude) => {
|
|
1687
|
+
var target = {};
|
|
1688
|
+
for (var prop in source)
|
|
1689
|
+
if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1690
|
+
target[prop] = source[prop];
|
|
1691
|
+
if (source != null && __getOwnPropSymbols$h)
|
|
1692
|
+
for (var prop of __getOwnPropSymbols$h(source)) {
|
|
1693
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
|
|
1694
|
+
target[prop] = source[prop];
|
|
1695
|
+
}
|
|
1696
|
+
return target;
|
|
1697
|
+
};
|
|
1777
1698
|
function BaseSection(props) {
|
|
1778
|
-
const
|
|
1779
|
-
const
|
|
1780
|
-
const
|
|
1781
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$h({
|
|
1782
|
-
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1783
|
-
}));
|
|
1699
|
+
const _a = props, { header, items } = _a, rest = __objRest$g(_a, ["header", "items"]);
|
|
1700
|
+
const contextProps = React__default.default.useContext(PlasmicListBoxContext);
|
|
1701
|
+
const mergedProps = utils.mergeProps(contextProps, rest);
|
|
1702
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, null, header), items);
|
|
1784
1703
|
}
|
|
1785
1704
|
function registerSection(loader, overrides) {
|
|
1786
|
-
const thisName = makeChildComponentName(
|
|
1787
|
-
overrides == null ? void 0 : overrides.parentComponentName,
|
|
1788
|
-
makeComponentName("section")
|
|
1789
|
-
);
|
|
1790
|
-
const headerMeta = registerHeader(loader, {
|
|
1791
|
-
parentComponentName: thisName
|
|
1792
|
-
});
|
|
1793
1705
|
return registerComponentHelper(
|
|
1794
1706
|
loader,
|
|
1795
1707
|
BaseSection,
|
|
@@ -1803,14 +1715,17 @@ function registerSection(loader, overrides) {
|
|
|
1803
1715
|
padding: "10px"
|
|
1804
1716
|
},
|
|
1805
1717
|
props: {
|
|
1806
|
-
|
|
1718
|
+
header: {
|
|
1807
1719
|
type: "slot",
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1720
|
+
defaultValue: [
|
|
1721
|
+
{
|
|
1722
|
+
type: "text",
|
|
1723
|
+
value: "Section Header."
|
|
1724
|
+
}
|
|
1725
|
+
]
|
|
1726
|
+
},
|
|
1727
|
+
items: {
|
|
1728
|
+
type: "slot"
|
|
1814
1729
|
}
|
|
1815
1730
|
}
|
|
1816
1731
|
},
|
|
@@ -1819,8 +1734,6 @@ function registerSection(loader, overrides) {
|
|
|
1819
1734
|
}
|
|
1820
1735
|
|
|
1821
1736
|
var __defProp$g = Object.defineProperty;
|
|
1822
|
-
var __defProps$8 = Object.defineProperties;
|
|
1823
|
-
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
1824
1737
|
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
1825
1738
|
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
1826
1739
|
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
@@ -1836,8 +1749,7 @@ var __spreadValues$g = (a, b) => {
|
|
|
1836
1749
|
}
|
|
1837
1750
|
return a;
|
|
1838
1751
|
};
|
|
1839
|
-
var
|
|
1840
|
-
var __objRest$e = (source, exclude) => {
|
|
1752
|
+
var __objRest$f = (source, exclude) => {
|
|
1841
1753
|
var target = {};
|
|
1842
1754
|
for (var prop in source)
|
|
1843
1755
|
if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1849,37 +1761,71 @@ var __objRest$e = (source, exclude) => {
|
|
|
1849
1761
|
}
|
|
1850
1762
|
return target;
|
|
1851
1763
|
};
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
contextProps,
|
|
1859
|
-
rest,
|
|
1860
|
-
isStandalone ? { items: options } : {}
|
|
1861
|
-
), { renderItem, renderSection } = _b, mergedProps = __objRest$e(_b, ["renderItem", "renderSection"]);
|
|
1862
|
-
setControlContextData == null ? void 0 : setControlContextData({
|
|
1863
|
-
parent: isStandalone ? void 0 : {}
|
|
1864
|
-
});
|
|
1865
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, __spreadValues$g({}, mergedProps), (item) => {
|
|
1866
|
-
var _a2;
|
|
1867
|
-
if (item.type === "option-group") {
|
|
1868
|
-
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
1869
|
-
PlasmicSectionContext.Provider,
|
|
1870
|
-
{
|
|
1871
|
-
value: {
|
|
1872
|
-
renderItem,
|
|
1873
|
-
key: (_a2 = item.key) != null ? _a2 : item.label,
|
|
1874
|
-
section: item
|
|
1875
|
-
}
|
|
1876
|
-
},
|
|
1877
|
-
renderSection == null ? void 0 : renderSection(item)
|
|
1878
|
-
));
|
|
1879
|
-
} else {
|
|
1880
|
-
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1764
|
+
const listboxHelpers = {
|
|
1765
|
+
states: {
|
|
1766
|
+
selectedKey: {
|
|
1767
|
+
onChangeArgsToValue: (value) => {
|
|
1768
|
+
return Array.from(value)[0];
|
|
1769
|
+
}
|
|
1881
1770
|
}
|
|
1882
|
-
}
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
function normalizeSelectedKeys(selectedKeys) {
|
|
1774
|
+
return typeof selectedKeys === "string" && selectedKeys !== "all" ? [selectedKeys] : selectedKeys;
|
|
1775
|
+
}
|
|
1776
|
+
function BaseListBox(props) {
|
|
1777
|
+
const _a = props, {
|
|
1778
|
+
setControlContextData,
|
|
1779
|
+
children,
|
|
1780
|
+
selectedKeys,
|
|
1781
|
+
defaultSelectedKeys
|
|
1782
|
+
} = _a, rest = __objRest$f(_a, [
|
|
1783
|
+
"setControlContextData",
|
|
1784
|
+
"children",
|
|
1785
|
+
"selectedKeys",
|
|
1786
|
+
"defaultSelectedKeys"
|
|
1787
|
+
]);
|
|
1788
|
+
const context = React__default.default.useContext(PlasmicListBoxContext);
|
|
1789
|
+
const isStandalone = !context;
|
|
1790
|
+
const [ids, setIds] = React.useState([]);
|
|
1791
|
+
const idManager = React.useMemo(
|
|
1792
|
+
() => {
|
|
1793
|
+
var _a2;
|
|
1794
|
+
return (_a2 = context == null ? void 0 : context.idManager) != null ? _a2 : new ListBoxItemIdManager();
|
|
1795
|
+
},
|
|
1796
|
+
[]
|
|
1797
|
+
);
|
|
1798
|
+
React.useEffect(() => {
|
|
1799
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1800
|
+
itemIds: ids,
|
|
1801
|
+
isStandalone
|
|
1802
|
+
});
|
|
1803
|
+
}, [ids, isStandalone]);
|
|
1804
|
+
React.useEffect(() => {
|
|
1805
|
+
idManager.subscribe((_ids) => {
|
|
1806
|
+
setIds(_ids);
|
|
1807
|
+
});
|
|
1808
|
+
}, []);
|
|
1809
|
+
const listbox = /* @__PURE__ */ React__default.default.createElement(
|
|
1810
|
+
reactAriaComponents.ListBox,
|
|
1811
|
+
__spreadValues$g({
|
|
1812
|
+
selectedKeys: normalizeSelectedKeys(selectedKeys),
|
|
1813
|
+
defaultSelectedKeys: normalizeSelectedKeys(defaultSelectedKeys)
|
|
1814
|
+
}, rest),
|
|
1815
|
+
children
|
|
1816
|
+
);
|
|
1817
|
+
if (isStandalone) {
|
|
1818
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
1819
|
+
PlasmicListBoxContext.Provider,
|
|
1820
|
+
{
|
|
1821
|
+
value: {
|
|
1822
|
+
idManager
|
|
1823
|
+
}
|
|
1824
|
+
},
|
|
1825
|
+
listbox
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1828
|
+
return listbox;
|
|
1883
1829
|
}
|
|
1884
1830
|
const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
|
|
1885
1831
|
function registerListBox(loader, overrides) {
|
|
@@ -1887,7 +1833,56 @@ function registerListBox(loader, overrides) {
|
|
|
1887
1833
|
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1888
1834
|
});
|
|
1889
1835
|
const sectionMeta = registerSection(loader, {
|
|
1890
|
-
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1836
|
+
parentComponentName: LIST_BOX_COMPONENT_NAME,
|
|
1837
|
+
props: {
|
|
1838
|
+
items: {
|
|
1839
|
+
type: "slot",
|
|
1840
|
+
defaultValue: [
|
|
1841
|
+
{
|
|
1842
|
+
type: "component",
|
|
1843
|
+
name: listBoxItemMeta.name,
|
|
1844
|
+
props: {
|
|
1845
|
+
id: "section-1-1",
|
|
1846
|
+
textValue: "Section1-Item 1",
|
|
1847
|
+
children: [
|
|
1848
|
+
makeDefaultListBoxItemChildren(
|
|
1849
|
+
"Item 1",
|
|
1850
|
+
"Add dynamic values to make it more interesting"
|
|
1851
|
+
)
|
|
1852
|
+
]
|
|
1853
|
+
}
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
type: "component",
|
|
1857
|
+
name: listBoxItemMeta.name,
|
|
1858
|
+
props: {
|
|
1859
|
+
id: "section-1-2",
|
|
1860
|
+
textValue: "Section1-Item 2",
|
|
1861
|
+
children: [
|
|
1862
|
+
makeDefaultListBoxItemChildren(
|
|
1863
|
+
"Item 2",
|
|
1864
|
+
"Add dynamic values to make it more interesting"
|
|
1865
|
+
)
|
|
1866
|
+
]
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
type: "component",
|
|
1871
|
+
name: listBoxItemMeta.name,
|
|
1872
|
+
props: {
|
|
1873
|
+
id: "section-1-3",
|
|
1874
|
+
textValue: "Section1-Item 3",
|
|
1875
|
+
children: [
|
|
1876
|
+
makeDefaultListBoxItemChildren(
|
|
1877
|
+
"Item 3",
|
|
1878
|
+
"Add dynamic values to make it more interesting"
|
|
1879
|
+
)
|
|
1880
|
+
]
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
]
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1891
1886
|
});
|
|
1892
1887
|
registerComponentHelper(
|
|
1893
1888
|
loader,
|
|
@@ -1904,38 +1899,97 @@ function registerListBox(loader, overrides) {
|
|
|
1904
1899
|
borderColor: "black"
|
|
1905
1900
|
},
|
|
1906
1901
|
props: {
|
|
1907
|
-
|
|
1908
|
-
displayName: "Items",
|
|
1909
|
-
hidden: hasParent
|
|
1910
|
-
}),
|
|
1911
|
-
renderItem: {
|
|
1902
|
+
children: {
|
|
1912
1903
|
type: "slot",
|
|
1913
|
-
displayName: "
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1904
|
+
displayName: "List Items",
|
|
1905
|
+
allowedComponents: [listBoxItemMeta.name, sectionMeta.name],
|
|
1906
|
+
allowRootWrapper: true,
|
|
1907
|
+
defaultValue: [
|
|
1908
|
+
{
|
|
1909
|
+
type: "component",
|
|
1910
|
+
name: listBoxItemMeta.name,
|
|
1911
|
+
props: {
|
|
1912
|
+
id: "1",
|
|
1913
|
+
textValue: "Item 1",
|
|
1914
|
+
children: [
|
|
1915
|
+
makeDefaultListBoxItemChildren(
|
|
1916
|
+
"Item 1",
|
|
1917
|
+
"Add dynamic values to make it more interesting"
|
|
1918
|
+
)
|
|
1919
|
+
]
|
|
1920
|
+
}
|
|
1921
|
+
},
|
|
1922
|
+
{
|
|
1923
|
+
type: "component",
|
|
1924
|
+
name: listBoxItemMeta.name,
|
|
1925
|
+
props: {
|
|
1926
|
+
id: "2",
|
|
1927
|
+
textValue: "Item 2",
|
|
1928
|
+
children: [
|
|
1929
|
+
makeDefaultListBoxItemChildren(
|
|
1930
|
+
"Item 2",
|
|
1931
|
+
"Add dynamic values to make it more interesting"
|
|
1932
|
+
)
|
|
1933
|
+
]
|
|
1934
|
+
}
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
type: "component",
|
|
1938
|
+
name: listBoxItemMeta.name,
|
|
1939
|
+
props: {
|
|
1940
|
+
id: "3",
|
|
1941
|
+
textValue: "Item 3",
|
|
1942
|
+
children: [
|
|
1943
|
+
makeDefaultListBoxItemChildren(
|
|
1944
|
+
"Item 3",
|
|
1945
|
+
"Add dynamic values to make it more interesting"
|
|
1946
|
+
)
|
|
1947
|
+
]
|
|
1948
|
+
}
|
|
1949
|
+
},
|
|
1950
|
+
{
|
|
1951
|
+
type: "component",
|
|
1952
|
+
name: sectionMeta.name
|
|
1923
1953
|
}
|
|
1924
|
-
|
|
1954
|
+
]
|
|
1925
1955
|
},
|
|
1926
|
-
|
|
1927
|
-
type: "
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
defaultValue:
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1956
|
+
selectionMode: {
|
|
1957
|
+
type: "choice",
|
|
1958
|
+
description: "The selection mode of the listbox",
|
|
1959
|
+
options: ["none", "single"],
|
|
1960
|
+
defaultValue: "none",
|
|
1961
|
+
hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1962
|
+
},
|
|
1963
|
+
selectedKeys: {
|
|
1964
|
+
type: "choice",
|
|
1965
|
+
description: "The selected keys of the listbox",
|
|
1966
|
+
editOnly: true,
|
|
1967
|
+
uncontrolledProp: "defaultSelectedKeys",
|
|
1968
|
+
displayName: "Initial selected key",
|
|
1969
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
1970
|
+
hidden: (props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone) || props.selectionMode === "none",
|
|
1971
|
+
// We do not support multiple selections yet (Because React Aria select and combobox only support single selections).
|
|
1972
|
+
multiSelect: false
|
|
1973
|
+
},
|
|
1974
|
+
onSelectionChange: {
|
|
1975
|
+
type: "eventHandler",
|
|
1976
|
+
argTypes: [{ name: "itemIds", type: "object" }]
|
|
1937
1977
|
}
|
|
1938
|
-
}
|
|
1978
|
+
},
|
|
1979
|
+
states: {
|
|
1980
|
+
selectedKey: __spreadValues$g({
|
|
1981
|
+
type: "writable",
|
|
1982
|
+
valueProp: "selectedKeys",
|
|
1983
|
+
onChangeProp: "onSelectionChange",
|
|
1984
|
+
variableType: "text"
|
|
1985
|
+
}, listboxHelpers.states.selectedKey)
|
|
1986
|
+
},
|
|
1987
|
+
componentHelpers: {
|
|
1988
|
+
helpers: listboxHelpers,
|
|
1989
|
+
importName: "listboxHelpers",
|
|
1990
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerListBox"
|
|
1991
|
+
},
|
|
1992
|
+
trapsFocus: true
|
|
1939
1993
|
},
|
|
1940
1994
|
overrides
|
|
1941
1995
|
);
|
|
@@ -1957,7 +2011,7 @@ var __spreadValues$f = (a, b) => {
|
|
|
1957
2011
|
}
|
|
1958
2012
|
return a;
|
|
1959
2013
|
};
|
|
1960
|
-
var __objRest$
|
|
2014
|
+
var __objRest$e = (source, exclude) => {
|
|
1961
2015
|
var target = {};
|
|
1962
2016
|
for (var prop in source)
|
|
1963
2017
|
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1970,7 +2024,7 @@ var __objRest$d = (source, exclude) => {
|
|
|
1970
2024
|
return target;
|
|
1971
2025
|
};
|
|
1972
2026
|
function BasePopover(props) {
|
|
1973
|
-
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$
|
|
2027
|
+
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$e(_a, ["resetClassName", "setControlContextData"]);
|
|
1974
2028
|
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
1975
2029
|
const context = React__default.default.useContext(PlasmicPopoverContext);
|
|
1976
2030
|
const isInsideSelect = !!React__default.default.useContext(reactAriaComponents.SelectContext);
|
|
@@ -2003,7 +2057,6 @@ function BasePopover(props) {
|
|
|
2003
2057
|
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
2004
2058
|
const POPOVER_ARROW_IMG = {
|
|
2005
2059
|
type: "img",
|
|
2006
|
-
// TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
|
|
2007
2060
|
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
2008
2061
|
styles: {
|
|
2009
2062
|
position: "absolute",
|
|
@@ -2067,7 +2120,7 @@ function registerPopover(loader, overrides) {
|
|
|
2067
2120
|
type: "number",
|
|
2068
2121
|
displayName: "Offset",
|
|
2069
2122
|
description: "Additional offset applied vertically between the popover and its trigger",
|
|
2070
|
-
defaultValueHint:
|
|
2123
|
+
defaultValueHint: 8
|
|
2071
2124
|
},
|
|
2072
2125
|
shouldFlip: {
|
|
2073
2126
|
type: "boolean",
|
|
@@ -2101,8 +2154,8 @@ function registerPopover(loader, overrides) {
|
|
|
2101
2154
|
}
|
|
2102
2155
|
|
|
2103
2156
|
var __defProp$e = Object.defineProperty;
|
|
2104
|
-
var __defProps$
|
|
2105
|
-
var __getOwnPropDescs$
|
|
2157
|
+
var __defProps$8 = Object.defineProperties;
|
|
2158
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
2106
2159
|
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
2107
2160
|
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
2108
2161
|
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
@@ -2118,226 +2171,77 @@ var __spreadValues$e = (a, b) => {
|
|
|
2118
2171
|
}
|
|
2119
2172
|
return a;
|
|
2120
2173
|
};
|
|
2121
|
-
var __spreadProps$
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
placeholder,
|
|
2132
|
-
previewOpen,
|
|
2133
|
-
onOpenChange,
|
|
2134
|
-
isDisabled,
|
|
2135
|
-
className,
|
|
2136
|
-
style,
|
|
2137
|
-
structure,
|
|
2138
|
-
name
|
|
2139
|
-
} = props;
|
|
2140
|
-
const { options, optionText } = useStrictOptions(props);
|
|
2141
|
-
const { contains } = i18n.useFilter({ sensitivity: "base" });
|
|
2142
|
-
const [showAllOptions, setShowAllOptions] = React__default.default.useState(false);
|
|
2143
|
-
const filteredOptions = React__default.default.useMemo(() => {
|
|
2144
|
-
if (!filterValue || filterValue.trim().length === 0) {
|
|
2145
|
-
return options;
|
|
2146
|
-
}
|
|
2147
|
-
if (!options) {
|
|
2148
|
-
return options;
|
|
2174
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
2175
|
+
var __objRest$d = (source, exclude) => {
|
|
2176
|
+
var target = {};
|
|
2177
|
+
for (var prop in source)
|
|
2178
|
+
if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2179
|
+
target[prop] = source[prop];
|
|
2180
|
+
if (source != null && __getOwnPropSymbols$e)
|
|
2181
|
+
for (var prop of __getOwnPropSymbols$e(source)) {
|
|
2182
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
|
|
2183
|
+
target[prop] = source[prop];
|
|
2149
2184
|
}
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
}, [filterValue, options, contains, optionText]);
|
|
2169
|
-
const flattenedOptions = React__default.default.useMemo(
|
|
2170
|
-
() => flattenOptions(options),
|
|
2171
|
-
[options]
|
|
2172
|
-
);
|
|
2173
|
-
const disabledKeys = flattenedOptions.filter((op) => op.isDisabled).map((op) => op.id);
|
|
2174
|
-
const onSelectionChange = React__default.default.useCallback(
|
|
2175
|
-
(key) => {
|
|
2176
|
-
if (key === null) {
|
|
2177
|
-
return;
|
|
2178
|
-
}
|
|
2179
|
-
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find((op) => op.id === key);
|
|
2180
|
-
if (valueType === "text") {
|
|
2181
|
-
if (selectedOption) {
|
|
2182
|
-
onChange == null ? void 0 : onChange(optionText(selectedOption));
|
|
2183
|
-
}
|
|
2184
|
-
} else {
|
|
2185
|
-
onChange == null ? void 0 : onChange(key);
|
|
2186
|
-
}
|
|
2187
|
-
if (selectedOption) {
|
|
2188
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(optionText(selectedOption));
|
|
2189
|
-
}
|
|
2190
|
-
},
|
|
2191
|
-
[flattenedOptions, valueType, onChange, optionText, onFilterValueChange]
|
|
2192
|
-
);
|
|
2193
|
-
const onInputValueChange = React__default.default.useCallback(
|
|
2194
|
-
(newValue) => {
|
|
2195
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(newValue);
|
|
2196
|
-
setShowAllOptions(false);
|
|
2197
|
-
if (valueType === "text") {
|
|
2198
|
-
if (allowsCustomValue) {
|
|
2199
|
-
onChange == null ? void 0 : onChange(newValue);
|
|
2200
|
-
} else {
|
|
2201
|
-
const matchingOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
2202
|
-
(op) => optionText(op) === newValue
|
|
2203
|
-
);
|
|
2204
|
-
if (matchingOption) {
|
|
2205
|
-
onChange == null ? void 0 : onChange(optionText(matchingOption));
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2185
|
+
return target;
|
|
2186
|
+
};
|
|
2187
|
+
const COMBOBOX_NAME = makeComponentName("combobox");
|
|
2188
|
+
function BaseComboBox(props) {
|
|
2189
|
+
const _a = props, { children, setControlContextData, isOpen } = _a, rest = __objRest$d(_a, ["children", "setControlContextData", "isOpen"]);
|
|
2190
|
+
const idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
|
|
2191
|
+
React.useEffect(() => {
|
|
2192
|
+
idManager.subscribe((ids) => {
|
|
2193
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2194
|
+
itemIds: ids
|
|
2195
|
+
});
|
|
2196
|
+
});
|
|
2197
|
+
}, []);
|
|
2198
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ComboBox, __spreadValues$e({}, rest), /* @__PURE__ */ React__default.default.createElement(PlasmicPopoverContext.Provider, { value: { isOpen } }, /* @__PURE__ */ React__default.default.createElement(
|
|
2199
|
+
PlasmicListBoxContext.Provider,
|
|
2200
|
+
{
|
|
2201
|
+
value: {
|
|
2202
|
+
idManager
|
|
2208
2203
|
}
|
|
2209
2204
|
},
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
onChange,
|
|
2213
|
-
flattenedOptions,
|
|
2214
|
-
optionText,
|
|
2215
|
-
valueType,
|
|
2216
|
-
allowsCustomValue
|
|
2217
|
-
]
|
|
2218
|
-
);
|
|
2219
|
-
const onBlur = React__default.default.useCallback(() => {
|
|
2220
|
-
if (!allowsCustomValue) {
|
|
2221
|
-
const selectedOption = flattenedOptions == null ? void 0 : flattenedOptions.find(
|
|
2222
|
-
(op) => valueType === "text" ? optionText(op) === value : op.id === value
|
|
2223
|
-
);
|
|
2224
|
-
if (selectedOption) {
|
|
2225
|
-
const selectedOptionText = optionText(selectedOption);
|
|
2226
|
-
if (selectedOptionText !== filterValue) {
|
|
2227
|
-
onFilterValueChange == null ? void 0 : onFilterValueChange(selectedOptionText);
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
}, [
|
|
2232
|
-
allowsCustomValue,
|
|
2233
|
-
flattenedOptions,
|
|
2234
|
-
valueType,
|
|
2235
|
-
optionText,
|
|
2236
|
-
value,
|
|
2237
|
-
filterValue,
|
|
2238
|
-
onFilterValueChange
|
|
2239
|
-
]);
|
|
2240
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
2241
|
-
reactAriaComponents.ComboBox,
|
|
2242
|
-
__spreadValues$e({
|
|
2243
|
-
selectedKey: value,
|
|
2244
|
-
onSelectionChange,
|
|
2245
|
-
isDisabled,
|
|
2246
|
-
className,
|
|
2247
|
-
style,
|
|
2248
|
-
items: showAllOptions ? options : filteredOptions,
|
|
2249
|
-
menuTrigger,
|
|
2250
|
-
inputValue: filterValue,
|
|
2251
|
-
onInputChange: onInputValueChange,
|
|
2252
|
-
allowsCustomValue,
|
|
2253
|
-
disabledKeys,
|
|
2254
|
-
onOpenChange: (isOpen, trigger) => {
|
|
2255
|
-
if (isOpen && trigger === "manual") {
|
|
2256
|
-
setShowAllOptions(true);
|
|
2257
|
-
} else {
|
|
2258
|
-
setShowAllOptions(false);
|
|
2259
|
-
}
|
|
2260
|
-
onOpenChange == null ? void 0 : onOpenChange(isOpen);
|
|
2261
|
-
},
|
|
2262
|
-
onBlur,
|
|
2263
|
-
formValue: valueType === "text" ? "text" : "key",
|
|
2264
|
-
name
|
|
2265
|
-
}, extractPlasmicDataProps(props)),
|
|
2266
|
-
/* @__PURE__ */ React__default.default.createElement(
|
|
2267
|
-
PlasmicListBoxContext.Provider,
|
|
2268
|
-
{
|
|
2269
|
-
value: {
|
|
2270
|
-
getItemType: (option) => option.type === "section" ? "section" : "item"
|
|
2271
|
-
}
|
|
2272
|
-
},
|
|
2273
|
-
/* @__PURE__ */ React__default.default.createElement(PlasmicInputContext.Provider, { value: { placeholder } }, structure)
|
|
2274
|
-
),
|
|
2275
|
-
/* @__PURE__ */ React__default.default.createElement(BaseComboBoxEffects, { previewOpen })
|
|
2276
|
-
);
|
|
2277
|
-
}
|
|
2278
|
-
function BaseComboBoxEffects(props) {
|
|
2279
|
-
const { previewOpen } = props;
|
|
2280
|
-
const comboBoxState = React__default.default.useContext(reactAriaComponents.ComboBoxStateContext);
|
|
2281
|
-
const prevPreviewOpenRef = React__default.default.useRef(previewOpen);
|
|
2282
|
-
React__default.default.useEffect(() => {
|
|
2283
|
-
if (comboBoxState) {
|
|
2284
|
-
if (previewOpen) {
|
|
2285
|
-
comboBoxState.open(void 0, "manual");
|
|
2286
|
-
} else if (prevPreviewOpenRef.current) {
|
|
2287
|
-
comboBoxState.close();
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
prevPreviewOpenRef.current = previewOpen;
|
|
2291
|
-
}, [previewOpen, comboBoxState, prevPreviewOpenRef]);
|
|
2292
|
-
return null;
|
|
2205
|
+
children
|
|
2206
|
+
)));
|
|
2293
2207
|
}
|
|
2294
2208
|
function registerComboBox(loader) {
|
|
2295
|
-
const rootName = makeComponentName("combobox");
|
|
2296
2209
|
registerComponentHelper(loader, BaseComboBox, {
|
|
2297
|
-
name:
|
|
2210
|
+
name: COMBOBOX_NAME,
|
|
2298
2211
|
displayName: "Aria ComboBox",
|
|
2299
2212
|
importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
|
|
2300
2213
|
importName: "BaseComboBox",
|
|
2301
|
-
props: {
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
filterValue: {
|
|
2309
|
-
type: "string"
|
|
2310
|
-
},
|
|
2311
|
-
onFilterValueChange: {
|
|
2312
|
-
type: "eventHandler",
|
|
2313
|
-
argTypes: [{ name: "value", type: "string" }]
|
|
2314
|
-
},
|
|
2315
|
-
isDisabled: {
|
|
2316
|
-
type: "boolean"
|
|
2317
|
-
},
|
|
2318
|
-
valueType: {
|
|
2319
|
-
displayName: "`value` Type",
|
|
2214
|
+
props: __spreadProps$8(__spreadValues$e({}, getCommonProps("ComboBox", [
|
|
2215
|
+
"name",
|
|
2216
|
+
"aria-label",
|
|
2217
|
+
"placeholder",
|
|
2218
|
+
"isDisabled"
|
|
2219
|
+
])), {
|
|
2220
|
+
selectedKey: {
|
|
2320
2221
|
type: "choice",
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2222
|
+
description: "The selected keys of the listbox",
|
|
2223
|
+
editOnly: true,
|
|
2224
|
+
uncontrolledProp: "defaultSelectedKey",
|
|
2225
|
+
displayName: "Initial selected key",
|
|
2226
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
2227
|
+
// React Aria ComboBox do not support multiple comboBoxions yet
|
|
2228
|
+
multiSelect: false
|
|
2328
2229
|
},
|
|
2329
|
-
|
|
2230
|
+
isOpen: {
|
|
2330
2231
|
type: "boolean",
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
hidden: (
|
|
2334
|
-
|
|
2232
|
+
defaultValue: false,
|
|
2233
|
+
// It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.
|
|
2234
|
+
hidden: () => true
|
|
2235
|
+
},
|
|
2236
|
+
onSelectionChange: {
|
|
2237
|
+
type: "eventHandler",
|
|
2238
|
+
argTypes: [{ name: "selectedKey", type: "string" }]
|
|
2335
2239
|
},
|
|
2336
2240
|
onOpenChange: {
|
|
2337
2241
|
type: "eventHandler",
|
|
2338
2242
|
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2339
2243
|
},
|
|
2340
|
-
|
|
2244
|
+
children: {
|
|
2341
2245
|
type: "slot",
|
|
2342
2246
|
defaultValue: [
|
|
2343
2247
|
{
|
|
@@ -2361,45 +2265,24 @@ function registerComboBox(loader) {
|
|
|
2361
2265
|
},
|
|
2362
2266
|
{
|
|
2363
2267
|
type: "hbox",
|
|
2364
|
-
styles: {
|
|
2365
|
-
width: "stretch",
|
|
2366
|
-
borderWidth: "1px",
|
|
2367
|
-
borderStyle: "solid",
|
|
2368
|
-
borderColor: "black",
|
|
2369
|
-
padding: 0,
|
|
2370
|
-
position: "relative"
|
|
2371
|
-
},
|
|
2372
2268
|
children: [
|
|
2373
2269
|
{
|
|
2374
2270
|
type: "component",
|
|
2375
2271
|
name: INPUT_COMPONENT_NAME,
|
|
2376
2272
|
styles: {
|
|
2377
|
-
|
|
2378
|
-
width: "100%",
|
|
2379
|
-
padding: "2px 30px 2px 10px"
|
|
2273
|
+
width: "100%"
|
|
2380
2274
|
}
|
|
2381
2275
|
},
|
|
2382
2276
|
{
|
|
2383
2277
|
type: "component",
|
|
2384
2278
|
name: BUTTON_COMPONENT_NAME,
|
|
2385
|
-
styles: {
|
|
2386
|
-
borderWidth: 0,
|
|
2387
|
-
display: "flex",
|
|
2388
|
-
alignItems: "center",
|
|
2389
|
-
justifyContent: "center",
|
|
2390
|
-
position: "absolute",
|
|
2391
|
-
right: "10px",
|
|
2392
|
-
top: 0,
|
|
2393
|
-
padding: 0,
|
|
2394
|
-
height: "100%"
|
|
2395
|
-
},
|
|
2396
2279
|
props: {
|
|
2397
2280
|
children: {
|
|
2398
2281
|
type: "img",
|
|
2282
|
+
// TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
|
|
2399
2283
|
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
2400
2284
|
styles: {
|
|
2401
|
-
|
|
2402
|
-
width: "20px",
|
|
2285
|
+
width: "15px",
|
|
2403
2286
|
transform: "rotate(180deg)"
|
|
2404
2287
|
}
|
|
2405
2288
|
}
|
|
@@ -2412,15 +2295,18 @@ function registerComboBox(loader) {
|
|
|
2412
2295
|
name: POPOVER_COMPONENT_NAME,
|
|
2413
2296
|
styles: {
|
|
2414
2297
|
backgroundColor: "white",
|
|
2415
|
-
width: "300px",
|
|
2416
2298
|
padding: "10px",
|
|
2417
2299
|
overflow: "scroll"
|
|
2418
2300
|
},
|
|
2419
2301
|
props: {
|
|
2302
|
+
offset: 0,
|
|
2420
2303
|
children: [
|
|
2421
2304
|
{
|
|
2422
2305
|
type: "component",
|
|
2423
2306
|
name: LIST_BOX_COMPONENT_NAME,
|
|
2307
|
+
props: {
|
|
2308
|
+
selectionMode: "single"
|
|
2309
|
+
},
|
|
2424
2310
|
styles: {
|
|
2425
2311
|
borderWidth: 0,
|
|
2426
2312
|
width: "stretch"
|
|
@@ -2432,29 +2318,18 @@ function registerComboBox(loader) {
|
|
|
2432
2318
|
]
|
|
2433
2319
|
}
|
|
2434
2320
|
]
|
|
2435
|
-
},
|
|
2436
|
-
previewOpen: {
|
|
2437
|
-
type: "boolean",
|
|
2438
|
-
displayName: "Preview opened?",
|
|
2439
|
-
description: "Preview opened state while designing in Plasmic editor",
|
|
2440
|
-
editOnly: true
|
|
2441
2321
|
}
|
|
2442
|
-
},
|
|
2322
|
+
}),
|
|
2443
2323
|
states: {
|
|
2444
|
-
|
|
2324
|
+
selectedKey: {
|
|
2445
2325
|
type: "writable",
|
|
2446
|
-
valueProp: "
|
|
2447
|
-
onChangeProp: "
|
|
2448
|
-
variableType: "text"
|
|
2449
|
-
},
|
|
2450
|
-
filterValue: {
|
|
2451
|
-
type: "writable",
|
|
2452
|
-
valueProp: "filterValue",
|
|
2453
|
-
onChangeProp: "onFilterValueChange",
|
|
2326
|
+
valueProp: "selectedKey",
|
|
2327
|
+
onChangeProp: "onSelectionChange",
|
|
2454
2328
|
variableType: "text"
|
|
2455
2329
|
},
|
|
2456
2330
|
isOpen: {
|
|
2457
|
-
type: "
|
|
2331
|
+
type: "writable",
|
|
2332
|
+
valueProp: "isOpen",
|
|
2458
2333
|
onChangeProp: "onOpenChange",
|
|
2459
2334
|
variableType: "boolean"
|
|
2460
2335
|
}
|
|
@@ -2463,8 +2338,8 @@ function registerComboBox(loader) {
|
|
|
2463
2338
|
}
|
|
2464
2339
|
|
|
2465
2340
|
var __defProp$d = Object.defineProperty;
|
|
2466
|
-
var __defProps$
|
|
2467
|
-
var __getOwnPropDescs$
|
|
2341
|
+
var __defProps$7 = Object.defineProperties;
|
|
2342
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
2468
2343
|
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
2469
2344
|
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
2470
2345
|
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
@@ -2480,7 +2355,7 @@ var __spreadValues$d = (a, b) => {
|
|
|
2480
2355
|
}
|
|
2481
2356
|
return a;
|
|
2482
2357
|
};
|
|
2483
|
-
var __spreadProps$
|
|
2358
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
2484
2359
|
var __objRest$c = (source, exclude) => {
|
|
2485
2360
|
var target = {};
|
|
2486
2361
|
for (var prop in source)
|
|
@@ -2534,7 +2409,7 @@ const BaseModal = React.forwardRef(
|
|
|
2534
2409
|
const body = /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, heading && /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Heading, { slot: "title" }, heading), children);
|
|
2535
2410
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
2536
2411
|
reactAriaComponents.ModalOverlay,
|
|
2537
|
-
__spreadProps$
|
|
2412
|
+
__spreadProps$7(__spreadValues$d({}, mergedProps), {
|
|
2538
2413
|
className: `${resetClassName} ${modalOverlayClass}`
|
|
2539
2414
|
}),
|
|
2540
2415
|
/* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className }, isCanvas ? body : /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Dialog, null, body))
|
|
@@ -2833,8 +2708,8 @@ function registerForm(loader, overrides) {
|
|
|
2833
2708
|
}
|
|
2834
2709
|
|
|
2835
2710
|
var __defProp$a = Object.defineProperty;
|
|
2836
|
-
var __defProps$
|
|
2837
|
-
var __getOwnPropDescs$
|
|
2711
|
+
var __defProps$6 = Object.defineProperties;
|
|
2712
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
2838
2713
|
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
2839
2714
|
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
2840
2715
|
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
@@ -2850,7 +2725,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
2850
2725
|
}
|
|
2851
2726
|
return a;
|
|
2852
2727
|
};
|
|
2853
|
-
var __spreadProps$
|
|
2728
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
2854
2729
|
var __objRest$9 = (source, exclude) => {
|
|
2855
2730
|
var target = {};
|
|
2856
2731
|
for (var prop in source)
|
|
@@ -2951,7 +2826,7 @@ function registerRadio(loader, overrides) {
|
|
|
2951
2826
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
|
|
2952
2827
|
importName: "BaseRadio",
|
|
2953
2828
|
interactionVariants: interactionVariants$8,
|
|
2954
|
-
props: __spreadProps$
|
|
2829
|
+
props: __spreadProps$6(__spreadValues$a({}, getCommonProps("radio", [
|
|
2955
2830
|
"isDisabled",
|
|
2956
2831
|
"autoFocus",
|
|
2957
2832
|
"aria-label"
|
|
@@ -2973,8 +2848,8 @@ function registerRadio(loader, overrides) {
|
|
|
2973
2848
|
}
|
|
2974
2849
|
|
|
2975
2850
|
var __defProp$9 = Object.defineProperty;
|
|
2976
|
-
var __defProps$
|
|
2977
|
-
var __getOwnPropDescs$
|
|
2851
|
+
var __defProps$5 = Object.defineProperties;
|
|
2852
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
2978
2853
|
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
2979
2854
|
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
2980
2855
|
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2990,7 +2865,7 @@ var __spreadValues$9 = (a, b) => {
|
|
|
2990
2865
|
}
|
|
2991
2866
|
return a;
|
|
2992
2867
|
};
|
|
2993
|
-
var __spreadProps$
|
|
2868
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
2994
2869
|
var __objRest$8 = (source, exclude) => {
|
|
2995
2870
|
var target = {};
|
|
2996
2871
|
for (var prop in source)
|
|
@@ -3039,7 +2914,7 @@ function registerRadioGroup(loader, overrides) {
|
|
|
3039
2914
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
|
|
3040
2915
|
importName: "BaseRadioGroup",
|
|
3041
2916
|
interactionVariants: interactionVariants$7,
|
|
3042
|
-
props: __spreadProps$
|
|
2917
|
+
props: __spreadProps$5(__spreadValues$9({}, getCommonProps("radio group", [
|
|
3043
2918
|
"name",
|
|
3044
2919
|
"isDisabled",
|
|
3045
2920
|
"isReadOnly",
|
|
@@ -3146,6 +3021,8 @@ function registerRadioGroup(loader, overrides) {
|
|
|
3146
3021
|
}
|
|
3147
3022
|
|
|
3148
3023
|
var __defProp$8 = Object.defineProperty;
|
|
3024
|
+
var __defProps$4 = Object.defineProperties;
|
|
3025
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
3149
3026
|
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
3150
3027
|
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
3151
3028
|
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
@@ -3161,6 +3038,7 @@ var __spreadValues$8 = (a, b) => {
|
|
|
3161
3038
|
}
|
|
3162
3039
|
return a;
|
|
3163
3040
|
};
|
|
3041
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
3164
3042
|
const BaseSelectValue = (props) => {
|
|
3165
3043
|
const { children, customize } = props;
|
|
3166
3044
|
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SelectValue, null, ({ isPlaceholder, selectedText }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isPlaceholder ? /* @__PURE__ */ React__default.default.createElement("span", null, "Select an item") : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("span", null, customize ? children : selectedText))));
|
|
@@ -3168,29 +3046,36 @@ const BaseSelectValue = (props) => {
|
|
|
3168
3046
|
const SELECT_NAME = makeComponentName("select");
|
|
3169
3047
|
function BaseSelect(props) {
|
|
3170
3048
|
const {
|
|
3171
|
-
|
|
3172
|
-
|
|
3049
|
+
selectedKey,
|
|
3050
|
+
onSelectionChange,
|
|
3173
3051
|
placeholder,
|
|
3174
3052
|
previewOpen,
|
|
3175
3053
|
onOpenChange,
|
|
3176
3054
|
isDisabled,
|
|
3177
3055
|
className,
|
|
3178
3056
|
style,
|
|
3179
|
-
|
|
3057
|
+
children,
|
|
3180
3058
|
name,
|
|
3181
3059
|
isOpen,
|
|
3060
|
+
setControlContextData,
|
|
3182
3061
|
"aria-label": ariaLabel
|
|
3183
3062
|
} = props;
|
|
3184
|
-
const { options } = useStrictOptions(props);
|
|
3185
3063
|
const isEditMode = !!host.usePlasmicCanvasContext();
|
|
3186
3064
|
const openProp = isEditMode && previewOpen ? true : isOpen;
|
|
3187
|
-
|
|
3065
|
+
let idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
|
|
3066
|
+
React.useEffect(() => {
|
|
3067
|
+
idManager.subscribe((ids) => {
|
|
3068
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
3069
|
+
itemIds: ids
|
|
3070
|
+
});
|
|
3071
|
+
});
|
|
3072
|
+
}, []);
|
|
3188
3073
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
3189
3074
|
reactAriaComponents.Select,
|
|
3190
3075
|
__spreadValues$8({
|
|
3191
3076
|
placeholder,
|
|
3192
|
-
selectedKey
|
|
3193
|
-
onSelectionChange
|
|
3077
|
+
selectedKey,
|
|
3078
|
+
onSelectionChange,
|
|
3194
3079
|
onOpenChange,
|
|
3195
3080
|
isDisabled,
|
|
3196
3081
|
className,
|
|
@@ -3203,11 +3088,10 @@ function BaseSelect(props) {
|
|
|
3203
3088
|
PlasmicListBoxContext.Provider,
|
|
3204
3089
|
{
|
|
3205
3090
|
value: {
|
|
3206
|
-
|
|
3207
|
-
disabledKeys
|
|
3091
|
+
idManager
|
|
3208
3092
|
}
|
|
3209
3093
|
},
|
|
3210
|
-
|
|
3094
|
+
children
|
|
3211
3095
|
))
|
|
3212
3096
|
);
|
|
3213
3097
|
}
|
|
@@ -3249,27 +3133,44 @@ function registerSelect(loader) {
|
|
|
3249
3133
|
displayName: "Aria Select",
|
|
3250
3134
|
importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
|
|
3251
3135
|
importName: "BaseSelect",
|
|
3252
|
-
props: {
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3136
|
+
props: __spreadProps$4(__spreadValues$8({}, getCommonProps("Select", [
|
|
3137
|
+
"name",
|
|
3138
|
+
"aria-label",
|
|
3139
|
+
"placeholder",
|
|
3140
|
+
"isDisabled",
|
|
3141
|
+
"autoFocus"
|
|
3142
|
+
])), {
|
|
3143
|
+
selectedKey: {
|
|
3144
|
+
type: "choice",
|
|
3145
|
+
description: "The selected keys of the listbox",
|
|
3146
|
+
editOnly: true,
|
|
3147
|
+
uncontrolledProp: "defaultSelectedKey",
|
|
3148
|
+
displayName: "Initial selected key",
|
|
3149
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
3150
|
+
// React Aria Select do not support multiple selections yet
|
|
3151
|
+
multiSelect: false
|
|
3259
3152
|
},
|
|
3260
|
-
|
|
3261
|
-
onChange: {
|
|
3153
|
+
onSelectionChange: {
|
|
3262
3154
|
type: "eventHandler",
|
|
3263
3155
|
argTypes: [{ name: "value", type: "string" }]
|
|
3264
3156
|
},
|
|
3157
|
+
disabledKeys: {
|
|
3158
|
+
type: "choice",
|
|
3159
|
+
description: "The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.",
|
|
3160
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
3161
|
+
multiSelect: true,
|
|
3162
|
+
advanced: true
|
|
3163
|
+
},
|
|
3265
3164
|
previewOpen: {
|
|
3266
3165
|
type: "boolean",
|
|
3267
3166
|
displayName: "Preview opened?",
|
|
3268
3167
|
description: "Preview opened state while designing in Plasmic editor",
|
|
3269
|
-
editOnly: true
|
|
3168
|
+
editOnly: true,
|
|
3169
|
+
defaultValue: false
|
|
3270
3170
|
},
|
|
3271
3171
|
isOpen: {
|
|
3272
3172
|
type: "boolean",
|
|
3173
|
+
defaultValue: false,
|
|
3273
3174
|
// It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.
|
|
3274
3175
|
hidden: () => true
|
|
3275
3176
|
},
|
|
@@ -3277,40 +3178,7 @@ function registerSelect(loader) {
|
|
|
3277
3178
|
type: "eventHandler",
|
|
3278
3179
|
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
3279
3180
|
},
|
|
3280
|
-
|
|
3281
|
-
// type: "string",
|
|
3282
|
-
// displayName: "Field key for an option's value",
|
|
3283
|
-
// hidden: (ps) =>
|
|
3284
|
-
// !ps.options ||
|
|
3285
|
-
// !ps.options[0] ||
|
|
3286
|
-
// typeof ps.options[0] === "string" ||
|
|
3287
|
-
// "value" in ps.options[0],
|
|
3288
|
-
// exprHint:
|
|
3289
|
-
// "Return a function that takes in an option object, and returns the key to use",
|
|
3290
|
-
// },
|
|
3291
|
-
// optionText: {
|
|
3292
|
-
// type: "string",
|
|
3293
|
-
// displayName: "Field key for an option's text value",
|
|
3294
|
-
// hidden: (ps) =>
|
|
3295
|
-
// !ps.options ||
|
|
3296
|
-
// !ps.options[0] ||
|
|
3297
|
-
// typeof ps.options[0] === "string" ||
|
|
3298
|
-
// "value" in ps.options[0],
|
|
3299
|
-
// exprHint:
|
|
3300
|
-
// "Return a function that takes in an option object, and returns the text value to use",
|
|
3301
|
-
// },
|
|
3302
|
-
// optionDisabled: {
|
|
3303
|
-
// type: "string",
|
|
3304
|
-
// displayName: "Field key for whether an option is disabled",
|
|
3305
|
-
// hidden: (ps) =>
|
|
3306
|
-
// !ps.options ||
|
|
3307
|
-
// !ps.options[0] ||
|
|
3308
|
-
// typeof ps.options[0] === "string" ||
|
|
3309
|
-
// "value" in ps.options[0],
|
|
3310
|
-
// exprHint:
|
|
3311
|
-
// "Return a function that takes in an option object, and returns true if option should be disabled",
|
|
3312
|
-
// },
|
|
3313
|
-
structure: {
|
|
3181
|
+
children: {
|
|
3314
3182
|
type: "slot",
|
|
3315
3183
|
defaultValue: [
|
|
3316
3184
|
{
|
|
@@ -3378,6 +3246,9 @@ function registerSelect(loader) {
|
|
|
3378
3246
|
{
|
|
3379
3247
|
type: "component",
|
|
3380
3248
|
name: LIST_BOX_COMPONENT_NAME,
|
|
3249
|
+
props: {
|
|
3250
|
+
selectionMode: "single"
|
|
3251
|
+
},
|
|
3381
3252
|
styles: {
|
|
3382
3253
|
borderWidth: 0,
|
|
3383
3254
|
width: "stretch"
|
|
@@ -3389,31 +3260,13 @@ function registerSelect(loader) {
|
|
|
3389
3260
|
]
|
|
3390
3261
|
}
|
|
3391
3262
|
]
|
|
3392
|
-
},
|
|
3393
|
-
// renderOption: {
|
|
3394
|
-
// type: "slot",
|
|
3395
|
-
// displayName: "Custom render option",
|
|
3396
|
-
// renderPropParams: ["item"],
|
|
3397
|
-
// hidePlaceholder: true
|
|
3398
|
-
// },
|
|
3399
|
-
name: {
|
|
3400
|
-
type: "string",
|
|
3401
|
-
displayName: "Form field key",
|
|
3402
|
-
description: "Name of the input, when submitting in an HTML form",
|
|
3403
|
-
advanced: true
|
|
3404
|
-
},
|
|
3405
|
-
"aria-label": {
|
|
3406
|
-
type: "string",
|
|
3407
|
-
displayName: "ARIA label",
|
|
3408
|
-
description: "Label for this input, if no visible label is used",
|
|
3409
|
-
advanced: true
|
|
3410
3263
|
}
|
|
3411
|
-
},
|
|
3264
|
+
}),
|
|
3412
3265
|
states: {
|
|
3413
|
-
|
|
3266
|
+
selectedKey: {
|
|
3414
3267
|
type: "writable",
|
|
3415
|
-
valueProp: "
|
|
3416
|
-
onChangeProp: "
|
|
3268
|
+
valueProp: "selectedKey",
|
|
3269
|
+
onChangeProp: "onSelectionChange",
|
|
3417
3270
|
variableType: "text"
|
|
3418
3271
|
},
|
|
3419
3272
|
isOpen: {
|
|
@@ -3488,6 +3341,22 @@ function registerSliderOutput(loader, overrides) {
|
|
|
3488
3341
|
);
|
|
3489
3342
|
}
|
|
3490
3343
|
|
|
3344
|
+
class ErrorBoundary extends React.Component {
|
|
3345
|
+
constructor(props) {
|
|
3346
|
+
super(props);
|
|
3347
|
+
this.state = { hasError: false };
|
|
3348
|
+
}
|
|
3349
|
+
static getDerivedStateFromError(_) {
|
|
3350
|
+
return { hasError: true };
|
|
3351
|
+
}
|
|
3352
|
+
render() {
|
|
3353
|
+
if (this.state.hasError) {
|
|
3354
|
+
return this.props.fallback;
|
|
3355
|
+
}
|
|
3356
|
+
return this.props.children;
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3491
3360
|
var __defProp$6 = Object.defineProperty;
|
|
3492
3361
|
var __defProps$3 = Object.defineProperties;
|
|
3493
3362
|
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|