@plasmicpkgs/react-aria 0.0.48 → 0.0.50
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 +726 -847
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +724 -845
- 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/registerModal.d.ts +1 -0
- 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 +5 -4
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +3 -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 +17 -5
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.d.ts +1 -0
- package/skinny/registerModal.esm.js +15 -3
- 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,7 @@ 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", [
|
|
579
575
|
"isDisabled",
|
|
580
576
|
"aria-label"
|
|
581
577
|
])), {
|
|
@@ -622,38 +618,36 @@ const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
|
622
618
|
React__default.default.createContext(void 0);
|
|
623
619
|
const PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
624
620
|
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);
|
|
621
|
+
React__default.default.createContext(void 0);
|
|
622
|
+
React__default.default.createContext(void 0);
|
|
629
623
|
|
|
630
|
-
var __defProp$
|
|
631
|
-
var __defProps$
|
|
632
|
-
var __getOwnPropDescs$
|
|
633
|
-
var __getOwnPropSymbols$
|
|
634
|
-
var __hasOwnProp$
|
|
635
|
-
var __propIsEnum$
|
|
636
|
-
var __defNormalProp$
|
|
637
|
-
var __spreadValues$
|
|
624
|
+
var __defProp$o = Object.defineProperty;
|
|
625
|
+
var __defProps$b = Object.defineProperties;
|
|
626
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
627
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
628
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
629
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
630
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
631
|
+
var __spreadValues$o = (a, b) => {
|
|
638
632
|
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$
|
|
633
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
634
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
635
|
+
if (__getOwnPropSymbols$o)
|
|
636
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
637
|
+
if (__propIsEnum$o.call(b, prop))
|
|
638
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
645
639
|
}
|
|
646
640
|
return a;
|
|
647
641
|
};
|
|
648
|
-
var __spreadProps$
|
|
649
|
-
var __objRest$
|
|
642
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
643
|
+
var __objRest$m = (source, exclude) => {
|
|
650
644
|
var target = {};
|
|
651
645
|
for (var prop in source)
|
|
652
|
-
if (__hasOwnProp$
|
|
646
|
+
if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
653
647
|
target[prop] = source[prop];
|
|
654
|
-
if (source != null && __getOwnPropSymbols$
|
|
655
|
-
for (var prop of __getOwnPropSymbols$
|
|
656
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
648
|
+
if (source != null && __getOwnPropSymbols$o)
|
|
649
|
+
for (var prop of __getOwnPropSymbols$o(source)) {
|
|
650
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
|
|
657
651
|
target[prop] = source[prop];
|
|
658
652
|
}
|
|
659
653
|
return target;
|
|
@@ -669,16 +663,16 @@ const CHECKBOX_INTERACTION_VARIANTS = [
|
|
|
669
663
|
"readonly",
|
|
670
664
|
"selected"
|
|
671
665
|
];
|
|
672
|
-
const { interactionVariants: interactionVariants$
|
|
666
|
+
const { interactionVariants: interactionVariants$c, withObservedValues: withObservedValues$a } = pickAriaComponentVariants(
|
|
673
667
|
CHECKBOX_INTERACTION_VARIANTS
|
|
674
668
|
);
|
|
675
669
|
function BaseCheckbox(props) {
|
|
676
|
-
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$
|
|
670
|
+
const _a = props, { children, updateInteractionVariant, setControlContextData } = _a, rest = __objRest$m(_a, ["children", "updateInteractionVariant", "setControlContextData"]);
|
|
677
671
|
const contextProps = React__default.default.useContext(PlasmicCheckboxGroupContext);
|
|
678
672
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
679
673
|
parent: contextProps
|
|
680
674
|
});
|
|
681
|
-
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$
|
|
675
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Checkbox, __spreadValues$o({}, rest), ({
|
|
682
676
|
isHovered,
|
|
683
677
|
isPressed,
|
|
684
678
|
isFocused,
|
|
@@ -687,7 +681,7 @@ function BaseCheckbox(props) {
|
|
|
687
681
|
isIndeterminate,
|
|
688
682
|
isSelected,
|
|
689
683
|
isReadOnly
|
|
690
|
-
}) => withObservedValues$
|
|
684
|
+
}) => withObservedValues$a(
|
|
691
685
|
children,
|
|
692
686
|
{
|
|
693
687
|
hovered: isHovered,
|
|
@@ -757,8 +751,8 @@ function registerCheckbox(loader, overrides) {
|
|
|
757
751
|
displayName: "Aria Checkbox",
|
|
758
752
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
759
753
|
importName: "BaseCheckbox",
|
|
760
|
-
interactionVariants: interactionVariants$
|
|
761
|
-
props: __spreadProps$
|
|
754
|
+
interactionVariants: interactionVariants$c,
|
|
755
|
+
props: __spreadProps$b(__spreadValues$o({}, getCommonProps("checkbox", [
|
|
762
756
|
"name",
|
|
763
757
|
"isDisabled",
|
|
764
758
|
"isReadOnly",
|
|
@@ -826,37 +820,37 @@ function registerCheckbox(loader, overrides) {
|
|
|
826
820
|
);
|
|
827
821
|
}
|
|
828
822
|
|
|
829
|
-
var __defProp$
|
|
830
|
-
var __getOwnPropSymbols$
|
|
831
|
-
var __hasOwnProp$
|
|
832
|
-
var __propIsEnum$
|
|
833
|
-
var __defNormalProp$
|
|
834
|
-
var __spreadValues$
|
|
823
|
+
var __defProp$n = Object.defineProperty;
|
|
824
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
825
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
826
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
827
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
828
|
+
var __spreadValues$n = (a, b) => {
|
|
835
829
|
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$
|
|
830
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
831
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
832
|
+
if (__getOwnPropSymbols$n)
|
|
833
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
834
|
+
if (__propIsEnum$n.call(b, prop))
|
|
835
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
842
836
|
}
|
|
843
837
|
return a;
|
|
844
838
|
};
|
|
845
|
-
var __objRest$
|
|
839
|
+
var __objRest$l = (source, exclude) => {
|
|
846
840
|
var target = {};
|
|
847
841
|
for (var prop in source)
|
|
848
|
-
if (__hasOwnProp$
|
|
842
|
+
if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
849
843
|
target[prop] = source[prop];
|
|
850
|
-
if (source != null && __getOwnPropSymbols$
|
|
851
|
-
for (var prop of __getOwnPropSymbols$
|
|
852
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
844
|
+
if (source != null && __getOwnPropSymbols$n)
|
|
845
|
+
for (var prop of __getOwnPropSymbols$n(source)) {
|
|
846
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
|
|
853
847
|
target[prop] = source[prop];
|
|
854
848
|
}
|
|
855
849
|
return target;
|
|
856
850
|
};
|
|
857
851
|
function BaseText(_a) {
|
|
858
|
-
var _b = _a, { children } = _b, rest = __objRest$
|
|
859
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$
|
|
852
|
+
var _b = _a, { children } = _b, rest = __objRest$l(_b, ["children"]);
|
|
853
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Text, __spreadValues$n({}, rest), children);
|
|
860
854
|
}
|
|
861
855
|
const TEXT_COMPONENT_NAME = makeComponentName("text");
|
|
862
856
|
function registerText(loader, overrides) {
|
|
@@ -890,28 +884,28 @@ function registerText(loader, overrides) {
|
|
|
890
884
|
);
|
|
891
885
|
}
|
|
892
886
|
|
|
893
|
-
var __defProp$
|
|
894
|
-
var __defProps$
|
|
895
|
-
var __getOwnPropDescs$
|
|
896
|
-
var __getOwnPropSymbols$
|
|
897
|
-
var __hasOwnProp$
|
|
898
|
-
var __propIsEnum$
|
|
899
|
-
var __defNormalProp$
|
|
900
|
-
var __spreadValues$
|
|
887
|
+
var __defProp$m = Object.defineProperty;
|
|
888
|
+
var __defProps$a = Object.defineProperties;
|
|
889
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
890
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
891
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
892
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
893
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
894
|
+
var __spreadValues$m = (a, b) => {
|
|
901
895
|
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$
|
|
896
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
897
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
898
|
+
if (__getOwnPropSymbols$m)
|
|
899
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
900
|
+
if (__propIsEnum$m.call(b, prop))
|
|
901
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
908
902
|
}
|
|
909
903
|
return a;
|
|
910
904
|
};
|
|
911
|
-
var __spreadProps$
|
|
905
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
912
906
|
const DESCRIPTION_COMPONENT_NAME = makeComponentName("description");
|
|
913
907
|
function registerDescription(loader, overrides) {
|
|
914
|
-
return registerText(loader, __spreadProps$
|
|
908
|
+
return registerText(loader, __spreadProps$a(__spreadValues$m({}, overrides), {
|
|
915
909
|
name: DESCRIPTION_COMPONENT_NAME,
|
|
916
910
|
displayName: "Aria Description",
|
|
917
911
|
props: {
|
|
@@ -924,30 +918,30 @@ function registerDescription(loader, overrides) {
|
|
|
924
918
|
}));
|
|
925
919
|
}
|
|
926
920
|
|
|
927
|
-
var __defProp$
|
|
928
|
-
var __getOwnPropSymbols$
|
|
929
|
-
var __hasOwnProp$
|
|
930
|
-
var __propIsEnum$
|
|
931
|
-
var __defNormalProp$
|
|
932
|
-
var __spreadValues$
|
|
921
|
+
var __defProp$l = Object.defineProperty;
|
|
922
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
923
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
924
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
925
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
926
|
+
var __spreadValues$l = (a, b) => {
|
|
933
927
|
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$
|
|
928
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
929
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
930
|
+
if (__getOwnPropSymbols$l)
|
|
931
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
932
|
+
if (__propIsEnum$l.call(b, prop))
|
|
933
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
940
934
|
}
|
|
941
935
|
return a;
|
|
942
936
|
};
|
|
943
|
-
var __objRest$
|
|
937
|
+
var __objRest$k = (source, exclude) => {
|
|
944
938
|
var target = {};
|
|
945
939
|
for (var prop in source)
|
|
946
|
-
if (__hasOwnProp$
|
|
940
|
+
if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
947
941
|
target[prop] = source[prop];
|
|
948
|
-
if (source != null && __getOwnPropSymbols$
|
|
949
|
-
for (var prop of __getOwnPropSymbols$
|
|
950
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
942
|
+
if (source != null && __getOwnPropSymbols$l)
|
|
943
|
+
for (var prop of __getOwnPropSymbols$l(source)) {
|
|
944
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
|
|
951
945
|
target[prop] = source[prop];
|
|
952
946
|
}
|
|
953
947
|
return target;
|
|
@@ -964,7 +958,7 @@ function BaseFieldError(_a) {
|
|
|
964
958
|
tooShort,
|
|
965
959
|
typeMismatch,
|
|
966
960
|
valueMissing
|
|
967
|
-
} = _b, rest = __objRest$
|
|
961
|
+
} = _b, rest = __objRest$k(_b, [
|
|
968
962
|
"badInput",
|
|
969
963
|
"customError",
|
|
970
964
|
"patternMismatch",
|
|
@@ -976,7 +970,7 @@ function BaseFieldError(_a) {
|
|
|
976
970
|
"typeMismatch",
|
|
977
971
|
"valueMissing"
|
|
978
972
|
]);
|
|
979
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$
|
|
973
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues$l({}, rest), ({ validationDetails, validationErrors }) => {
|
|
980
974
|
if (validationDetails.badInput && badInput) {
|
|
981
975
|
return badInput;
|
|
982
976
|
}
|
|
@@ -1108,33 +1102,33 @@ function registerLabel(loader, overrides) {
|
|
|
1108
1102
|
);
|
|
1109
1103
|
}
|
|
1110
1104
|
|
|
1111
|
-
var __defProp$
|
|
1112
|
-
var __defProps$
|
|
1113
|
-
var __getOwnPropDescs$
|
|
1114
|
-
var __getOwnPropSymbols$
|
|
1115
|
-
var __hasOwnProp$
|
|
1116
|
-
var __propIsEnum$
|
|
1117
|
-
var __defNormalProp$
|
|
1118
|
-
var __spreadValues$
|
|
1105
|
+
var __defProp$k = Object.defineProperty;
|
|
1106
|
+
var __defProps$9 = Object.defineProperties;
|
|
1107
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
1108
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
1109
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
1110
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
1111
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1112
|
+
var __spreadValues$k = (a, b) => {
|
|
1119
1113
|
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$
|
|
1114
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
1115
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
1116
|
+
if (__getOwnPropSymbols$k)
|
|
1117
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
1118
|
+
if (__propIsEnum$k.call(b, prop))
|
|
1119
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
1126
1120
|
}
|
|
1127
1121
|
return a;
|
|
1128
1122
|
};
|
|
1129
|
-
var __spreadProps$
|
|
1130
|
-
var __objRest$
|
|
1123
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
1124
|
+
var __objRest$j = (source, exclude) => {
|
|
1131
1125
|
var target = {};
|
|
1132
1126
|
for (var prop in source)
|
|
1133
|
-
if (__hasOwnProp$
|
|
1127
|
+
if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1134
1128
|
target[prop] = source[prop];
|
|
1135
|
-
if (source != null && __getOwnPropSymbols$
|
|
1136
|
-
for (var prop of __getOwnPropSymbols$
|
|
1137
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1129
|
+
if (source != null && __getOwnPropSymbols$k)
|
|
1130
|
+
for (var prop of __getOwnPropSymbols$k(source)) {
|
|
1131
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
|
|
1138
1132
|
target[prop] = source[prop];
|
|
1139
1133
|
}
|
|
1140
1134
|
return target;
|
|
@@ -1143,12 +1137,12 @@ const CHECKBOX_GROUP_INTERACTION_VARIANTS = [
|
|
|
1143
1137
|
"disabled",
|
|
1144
1138
|
"readonly"
|
|
1145
1139
|
];
|
|
1146
|
-
const { interactionVariants: interactionVariants$
|
|
1140
|
+
const { interactionVariants: interactionVariants$b, withObservedValues: withObservedValues$9 } = pickAriaComponentVariants(
|
|
1147
1141
|
CHECKBOX_GROUP_INTERACTION_VARIANTS
|
|
1148
1142
|
);
|
|
1149
1143
|
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$
|
|
1144
|
+
const _a = props, { children, updateInteractionVariant } = _a, rest = __objRest$j(_a, ["children", "updateInteractionVariant"]);
|
|
1145
|
+
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
1146
|
children,
|
|
1153
1147
|
{
|
|
1154
1148
|
disabled: isDisabled,
|
|
@@ -1176,8 +1170,8 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
1176
1170
|
displayName: "Aria Checkbox Group",
|
|
1177
1171
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckboxGroup",
|
|
1178
1172
|
importName: "BaseCheckboxGroup",
|
|
1179
|
-
interactionVariants: interactionVariants$
|
|
1180
|
-
props: __spreadProps$
|
|
1173
|
+
interactionVariants: interactionVariants$b,
|
|
1174
|
+
props: __spreadProps$9(__spreadValues$k({}, getCommonProps("checkbox group", [
|
|
1181
1175
|
"name",
|
|
1182
1176
|
"isDisabled",
|
|
1183
1177
|
"isReadOnly",
|
|
@@ -1292,195 +1286,80 @@ function registerCheckboxGroup(loader, overrides) {
|
|
|
1292
1286
|
);
|
|
1293
1287
|
}
|
|
1294
1288
|
|
|
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
|
-
}
|
|
1289
|
+
class ListBoxItemIdManager {
|
|
1290
|
+
constructor() {
|
|
1291
|
+
this._ids = /* @__PURE__ */ new Set();
|
|
1292
|
+
this._observers = /* @__PURE__ */ new Set();
|
|
1293
|
+
}
|
|
1294
|
+
generateDuplicateId(id, count = 1) {
|
|
1295
|
+
const dupId = `${id} duplicate(${count})`;
|
|
1296
|
+
if (this._ids.has(dupId)) {
|
|
1297
|
+
return this.generateDuplicateId(id, count + 1);
|
|
1355
1298
|
} else {
|
|
1356
|
-
return
|
|
1299
|
+
return dupId;
|
|
1357
1300
|
}
|
|
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
1301
|
}
|
|
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
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
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;
|
|
1302
|
+
generateMissingId(count = 1) {
|
|
1303
|
+
const missingId = `missing(${count})`;
|
|
1304
|
+
if (this._ids.has(missingId)) {
|
|
1305
|
+
return this.generateMissingId(count + 1);
|
|
1306
|
+
} else {
|
|
1307
|
+
return missingId;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
register(id) {
|
|
1311
|
+
let newId;
|
|
1312
|
+
if (!id) {
|
|
1313
|
+
newId = this.generateMissingId();
|
|
1314
|
+
} else if (this._ids.has(id)) {
|
|
1315
|
+
newId = this.generateDuplicateId(id);
|
|
1316
|
+
} else {
|
|
1317
|
+
newId = id;
|
|
1318
|
+
}
|
|
1319
|
+
this._ids.add(newId);
|
|
1320
|
+
this.notify();
|
|
1321
|
+
return newId;
|
|
1322
|
+
}
|
|
1323
|
+
unregister(id) {
|
|
1324
|
+
this._ids.delete(id);
|
|
1325
|
+
this.notify();
|
|
1326
|
+
}
|
|
1327
|
+
subscribe(observer) {
|
|
1328
|
+
this._observers.add(observer);
|
|
1329
|
+
}
|
|
1330
|
+
// Notify all observers about an event.
|
|
1331
|
+
notify() {
|
|
1332
|
+
this._observers.forEach((observer) => observer(this.ids));
|
|
1333
|
+
}
|
|
1334
|
+
get ids() {
|
|
1335
|
+
return Array.from(this._ids);
|
|
1336
|
+
}
|
|
1458
1337
|
}
|
|
1459
1338
|
|
|
1460
|
-
var __defProp$
|
|
1461
|
-
var __getOwnPropSymbols$
|
|
1462
|
-
var __hasOwnProp$
|
|
1463
|
-
var __propIsEnum$
|
|
1464
|
-
var __defNormalProp$
|
|
1465
|
-
var __spreadValues$
|
|
1339
|
+
var __defProp$j = Object.defineProperty;
|
|
1340
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
1341
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
1342
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
1343
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1344
|
+
var __spreadValues$j = (a, b) => {
|
|
1466
1345
|
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$
|
|
1346
|
+
if (__hasOwnProp$j.call(b, prop))
|
|
1347
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1348
|
+
if (__getOwnPropSymbols$j)
|
|
1349
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
|
1350
|
+
if (__propIsEnum$j.call(b, prop))
|
|
1351
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1473
1352
|
}
|
|
1474
1353
|
return a;
|
|
1475
1354
|
};
|
|
1476
|
-
var __objRest$
|
|
1355
|
+
var __objRest$i = (source, exclude) => {
|
|
1477
1356
|
var target = {};
|
|
1478
1357
|
for (var prop in source)
|
|
1479
|
-
if (__hasOwnProp$
|
|
1358
|
+
if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1480
1359
|
target[prop] = source[prop];
|
|
1481
|
-
if (source != null && __getOwnPropSymbols$
|
|
1482
|
-
for (var prop of __getOwnPropSymbols$
|
|
1483
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1360
|
+
if (source != null && __getOwnPropSymbols$j)
|
|
1361
|
+
for (var prop of __getOwnPropSymbols$j(source)) {
|
|
1362
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
|
|
1484
1363
|
target[prop] = source[prop];
|
|
1485
1364
|
}
|
|
1486
1365
|
return target;
|
|
@@ -1490,7 +1369,7 @@ const INPUT_INTERACTION_VARIANTS = [
|
|
|
1490
1369
|
"hovered",
|
|
1491
1370
|
"disabled"
|
|
1492
1371
|
];
|
|
1493
|
-
const { interactionVariants: interactionVariants$
|
|
1372
|
+
const { interactionVariants: interactionVariants$a } = pickAriaComponentVariants(
|
|
1494
1373
|
INPUT_INTERACTION_VARIANTS
|
|
1495
1374
|
);
|
|
1496
1375
|
const inputHelpers$1 = {
|
|
@@ -1509,7 +1388,7 @@ function BaseInput(props) {
|
|
|
1509
1388
|
setControlContextData,
|
|
1510
1389
|
disabled,
|
|
1511
1390
|
autoComplete
|
|
1512
|
-
} = _a, rest = __objRest$
|
|
1391
|
+
} = _a, rest = __objRest$i(_a, [
|
|
1513
1392
|
"updateInteractionVariant",
|
|
1514
1393
|
"setControlContextData",
|
|
1515
1394
|
"disabled",
|
|
@@ -1534,7 +1413,7 @@ function BaseInput(props) {
|
|
|
1534
1413
|
}, [mergedProps.disabled, updateInteractionVariant]);
|
|
1535
1414
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
1536
1415
|
reactAriaComponents.Input,
|
|
1537
|
-
__spreadValues$
|
|
1416
|
+
__spreadValues$j({
|
|
1538
1417
|
autoComplete: resolveAutoComplete(autoComplete),
|
|
1539
1418
|
onHoverChange: (isHovered) => {
|
|
1540
1419
|
updateInteractionVariant == null ? void 0 : updateInteractionVariant({
|
|
@@ -1564,15 +1443,15 @@ function registerInput(loader, overrides) {
|
|
|
1564
1443
|
displayName: "Aria Input",
|
|
1565
1444
|
importPath: "@plasmicpkgs/react-aria/skinny/registerInput",
|
|
1566
1445
|
importName: "BaseInput",
|
|
1567
|
-
interactionVariants: interactionVariants$
|
|
1446
|
+
interactionVariants: interactionVariants$a,
|
|
1568
1447
|
defaultStyles: {
|
|
1569
1448
|
width: "300px",
|
|
1570
1449
|
borderWidth: "1px",
|
|
1571
1450
|
borderStyle: "solid",
|
|
1572
1451
|
borderColor: "black",
|
|
1573
|
-
padding: "
|
|
1452
|
+
padding: "4px 10px"
|
|
1574
1453
|
},
|
|
1575
|
-
props: __spreadValues$
|
|
1454
|
+
props: __spreadValues$j({}, getCommonProps("Input", [
|
|
1576
1455
|
"name",
|
|
1577
1456
|
"disabled",
|
|
1578
1457
|
"readOnly",
|
|
@@ -1603,7 +1482,7 @@ function registerInput(loader, overrides) {
|
|
|
1603
1482
|
"onInput"
|
|
1604
1483
|
])),
|
|
1605
1484
|
states: {
|
|
1606
|
-
value: __spreadValues$
|
|
1485
|
+
value: __spreadValues$j({
|
|
1607
1486
|
type: "writable",
|
|
1608
1487
|
valueProp: "value",
|
|
1609
1488
|
onChangeProp: "onChange",
|
|
@@ -1621,46 +1500,98 @@ function registerInput(loader, overrides) {
|
|
|
1621
1500
|
);
|
|
1622
1501
|
}
|
|
1623
1502
|
|
|
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) => {
|
|
1503
|
+
var __defProp$i = Object.defineProperty;
|
|
1504
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
1505
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
1506
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
1507
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1508
|
+
var __spreadValues$i = (a, b) => {
|
|
1648
1509
|
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$
|
|
1510
|
+
if (__hasOwnProp$i.call(b, prop))
|
|
1511
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1512
|
+
if (__getOwnPropSymbols$i)
|
|
1513
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
|
1514
|
+
if (__propIsEnum$i.call(b, prop))
|
|
1515
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1655
1516
|
}
|
|
1656
1517
|
return a;
|
|
1657
1518
|
};
|
|
1658
|
-
var
|
|
1519
|
+
var __objRest$h = (source, exclude) => {
|
|
1520
|
+
var target = {};
|
|
1521
|
+
for (var prop in source)
|
|
1522
|
+
if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1523
|
+
target[prop] = source[prop];
|
|
1524
|
+
if (source != null && __getOwnPropSymbols$i)
|
|
1525
|
+
for (var prop of __getOwnPropSymbols$i(source)) {
|
|
1526
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
|
|
1527
|
+
target[prop] = source[prop];
|
|
1528
|
+
}
|
|
1529
|
+
return target;
|
|
1530
|
+
};
|
|
1531
|
+
const LIST_BOX_ITEM_INTERACTION_VARIANTS = [
|
|
1532
|
+
"hovered",
|
|
1533
|
+
"pressed",
|
|
1534
|
+
"focused",
|
|
1535
|
+
"focusVisible",
|
|
1536
|
+
"selected",
|
|
1537
|
+
"disabled"
|
|
1538
|
+
];
|
|
1539
|
+
const { interactionVariants: interactionVariants$9, withObservedValues: withObservedValues$8 } = pickAriaComponentVariants(
|
|
1540
|
+
LIST_BOX_ITEM_INTERACTION_VARIANTS
|
|
1541
|
+
);
|
|
1659
1542
|
function BaseListBoxItem(props) {
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1543
|
+
const _a = props, {
|
|
1544
|
+
children,
|
|
1545
|
+
setControlContextData,
|
|
1546
|
+
updateInteractionVariant,
|
|
1547
|
+
id
|
|
1548
|
+
} = _a, rest = __objRest$h(_a, [
|
|
1549
|
+
"children",
|
|
1550
|
+
"setControlContextData",
|
|
1551
|
+
"updateInteractionVariant",
|
|
1552
|
+
"id"
|
|
1553
|
+
]);
|
|
1554
|
+
const listboxContext = React__default.default.useContext(PlasmicListBoxContext);
|
|
1555
|
+
const isStandalone = !listboxContext;
|
|
1556
|
+
const [registeredId, setRegisteredId] = React.useState();
|
|
1557
|
+
React.useEffect(() => {
|
|
1558
|
+
if (!listboxContext) {
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
const localId = listboxContext.idManager.register(id);
|
|
1562
|
+
setRegisteredId(localId);
|
|
1563
|
+
return () => {
|
|
1564
|
+
listboxContext.idManager.unregister(localId);
|
|
1565
|
+
setRegisteredId(void 0);
|
|
1566
|
+
};
|
|
1567
|
+
}, [id]);
|
|
1568
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1569
|
+
// this means that a unique id was registered, different from the provided id
|
|
1570
|
+
hasDuplicateId: !isStandalone && id !== registeredId
|
|
1571
|
+
});
|
|
1572
|
+
const listboxItem = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues$i({ key: registeredId, id: registeredId }, rest), ({
|
|
1573
|
+
isHovered,
|
|
1574
|
+
isPressed,
|
|
1575
|
+
isFocused,
|
|
1576
|
+
isFocusVisible,
|
|
1577
|
+
isSelected,
|
|
1578
|
+
isDisabled
|
|
1579
|
+
}) => withObservedValues$8(
|
|
1580
|
+
children,
|
|
1581
|
+
{
|
|
1582
|
+
hovered: isHovered,
|
|
1583
|
+
pressed: isPressed,
|
|
1584
|
+
focused: isFocused,
|
|
1585
|
+
focusVisible: isFocusVisible,
|
|
1586
|
+
selected: isSelected,
|
|
1587
|
+
disabled: isDisabled
|
|
1588
|
+
},
|
|
1589
|
+
updateInteractionVariant
|
|
1590
|
+
));
|
|
1591
|
+
if (isStandalone) {
|
|
1592
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBox, { selectionMode: "single" }, listboxItem);
|
|
1593
|
+
}
|
|
1594
|
+
return listboxItem;
|
|
1664
1595
|
}
|
|
1665
1596
|
const makeDefaultListBoxItemChildren = (label, description) => ({
|
|
1666
1597
|
type: "vbox",
|
|
@@ -1708,7 +1639,23 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1708
1639
|
displayName: "Aria ListBoxItem",
|
|
1709
1640
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
1710
1641
|
importName: "BaseListBoxItem",
|
|
1642
|
+
interactionVariants: interactionVariants$9,
|
|
1711
1643
|
props: {
|
|
1644
|
+
id: {
|
|
1645
|
+
type: "string",
|
|
1646
|
+
description: "The id of the item",
|
|
1647
|
+
required: true,
|
|
1648
|
+
validator: (_value, _props, ctx) => {
|
|
1649
|
+
if (ctx == null ? void 0 : ctx.hasDuplicateId) {
|
|
1650
|
+
return "Please make sure the id is unique!";
|
|
1651
|
+
}
|
|
1652
|
+
return true;
|
|
1653
|
+
}
|
|
1654
|
+
},
|
|
1655
|
+
textValue: {
|
|
1656
|
+
type: "string",
|
|
1657
|
+
description: "A text representation of the item's contents, used for features like typeahead."
|
|
1658
|
+
},
|
|
1712
1659
|
children: {
|
|
1713
1660
|
type: "slot",
|
|
1714
1661
|
defaultValue: makeDefaultListBoxItemChildren("Item")
|
|
@@ -1719,45 +1666,6 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1719
1666
|
);
|
|
1720
1667
|
}
|
|
1721
1668
|
|
|
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
1669
|
var __defProp$h = Object.defineProperty;
|
|
1762
1670
|
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
|
1763
1671
|
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
|
@@ -1774,22 +1682,25 @@ var __spreadValues$h = (a, b) => {
|
|
|
1774
1682
|
}
|
|
1775
1683
|
return a;
|
|
1776
1684
|
};
|
|
1685
|
+
var __objRest$g = (source, exclude) => {
|
|
1686
|
+
var target = {};
|
|
1687
|
+
for (var prop in source)
|
|
1688
|
+
if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1689
|
+
target[prop] = source[prop];
|
|
1690
|
+
if (source != null && __getOwnPropSymbols$h)
|
|
1691
|
+
for (var prop of __getOwnPropSymbols$h(source)) {
|
|
1692
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
|
|
1693
|
+
target[prop] = source[prop];
|
|
1694
|
+
}
|
|
1695
|
+
return target;
|
|
1696
|
+
};
|
|
1777
1697
|
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
|
-
}));
|
|
1698
|
+
const _a = props, { header, items } = _a, rest = __objRest$g(_a, ["header", "items"]);
|
|
1699
|
+
const contextProps = React__default.default.useContext(PlasmicListBoxContext);
|
|
1700
|
+
const mergedProps = utils.mergeProps(contextProps, rest);
|
|
1701
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, null, header), items);
|
|
1784
1702
|
}
|
|
1785
1703
|
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
1704
|
return registerComponentHelper(
|
|
1794
1705
|
loader,
|
|
1795
1706
|
BaseSection,
|
|
@@ -1803,14 +1714,17 @@ function registerSection(loader, overrides) {
|
|
|
1803
1714
|
padding: "10px"
|
|
1804
1715
|
},
|
|
1805
1716
|
props: {
|
|
1806
|
-
|
|
1717
|
+
header: {
|
|
1807
1718
|
type: "slot",
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1719
|
+
defaultValue: [
|
|
1720
|
+
{
|
|
1721
|
+
type: "text",
|
|
1722
|
+
value: "Section Header."
|
|
1723
|
+
}
|
|
1724
|
+
]
|
|
1725
|
+
},
|
|
1726
|
+
items: {
|
|
1727
|
+
type: "slot"
|
|
1814
1728
|
}
|
|
1815
1729
|
}
|
|
1816
1730
|
},
|
|
@@ -1819,8 +1733,6 @@ function registerSection(loader, overrides) {
|
|
|
1819
1733
|
}
|
|
1820
1734
|
|
|
1821
1735
|
var __defProp$g = Object.defineProperty;
|
|
1822
|
-
var __defProps$8 = Object.defineProperties;
|
|
1823
|
-
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
1824
1736
|
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
1825
1737
|
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
1826
1738
|
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
@@ -1836,8 +1748,7 @@ var __spreadValues$g = (a, b) => {
|
|
|
1836
1748
|
}
|
|
1837
1749
|
return a;
|
|
1838
1750
|
};
|
|
1839
|
-
var
|
|
1840
|
-
var __objRest$e = (source, exclude) => {
|
|
1751
|
+
var __objRest$f = (source, exclude) => {
|
|
1841
1752
|
var target = {};
|
|
1842
1753
|
for (var prop in source)
|
|
1843
1754
|
if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1849,46 +1760,129 @@ var __objRest$e = (source, exclude) => {
|
|
|
1849
1760
|
}
|
|
1850
1761
|
return target;
|
|
1851
1762
|
};
|
|
1763
|
+
const listboxHelpers = {
|
|
1764
|
+
states: {
|
|
1765
|
+
selectedKey: {
|
|
1766
|
+
onChangeArgsToValue: (value) => {
|
|
1767
|
+
return Array.from(value)[0];
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
function normalizeSelectedKeys(selectedKeys) {
|
|
1773
|
+
return typeof selectedKeys === "string" && selectedKeys !== "all" ? [selectedKeys] : selectedKeys;
|
|
1774
|
+
}
|
|
1852
1775
|
function BaseListBox(props) {
|
|
1853
|
-
const
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1776
|
+
const _a = props, {
|
|
1777
|
+
setControlContextData,
|
|
1778
|
+
children,
|
|
1779
|
+
selectedKeys,
|
|
1780
|
+
defaultSelectedKeys
|
|
1781
|
+
} = _a, rest = __objRest$f(_a, [
|
|
1782
|
+
"setControlContextData",
|
|
1783
|
+
"children",
|
|
1784
|
+
"selectedKeys",
|
|
1785
|
+
"defaultSelectedKeys"
|
|
1786
|
+
]);
|
|
1787
|
+
const context = React__default.default.useContext(PlasmicListBoxContext);
|
|
1788
|
+
const isStandalone = !context;
|
|
1789
|
+
const [ids, setIds] = React.useState([]);
|
|
1790
|
+
const idManager = React.useMemo(
|
|
1791
|
+
() => {
|
|
1792
|
+
var _a2;
|
|
1793
|
+
return (_a2 = context == null ? void 0 : context.idManager) != null ? _a2 : new ListBoxItemIdManager();
|
|
1794
|
+
},
|
|
1795
|
+
[]
|
|
1796
|
+
);
|
|
1797
|
+
React.useEffect(() => {
|
|
1798
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
1799
|
+
itemIds: ids,
|
|
1800
|
+
isStandalone
|
|
1801
|
+
});
|
|
1802
|
+
}, [ids, isStandalone]);
|
|
1803
|
+
React.useEffect(() => {
|
|
1804
|
+
idManager.subscribe((_ids) => {
|
|
1805
|
+
setIds(_ids);
|
|
1806
|
+
});
|
|
1807
|
+
}, []);
|
|
1808
|
+
const listbox = /* @__PURE__ */ React__default.default.createElement(
|
|
1809
|
+
reactAriaComponents.ListBox,
|
|
1810
|
+
__spreadValues$g({
|
|
1811
|
+
selectedKeys: normalizeSelectedKeys(selectedKeys),
|
|
1812
|
+
defaultSelectedKeys: normalizeSelectedKeys(defaultSelectedKeys)
|
|
1813
|
+
}, rest),
|
|
1814
|
+
children
|
|
1815
|
+
);
|
|
1816
|
+
if (isStandalone) {
|
|
1817
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
1818
|
+
PlasmicListBoxContext.Provider,
|
|
1819
|
+
{
|
|
1820
|
+
value: {
|
|
1821
|
+
idManager
|
|
1822
|
+
}
|
|
1823
|
+
},
|
|
1824
|
+
listbox
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
return listbox;
|
|
1828
|
+
}
|
|
1829
|
+
const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
|
|
1830
|
+
function registerListBox(loader, overrides) {
|
|
1831
|
+
const listBoxItemMeta = registerListBoxItem(loader, {
|
|
1832
|
+
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1864
1833
|
});
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1834
|
+
const sectionMeta = registerSection(loader, {
|
|
1835
|
+
parentComponentName: LIST_BOX_COMPONENT_NAME,
|
|
1836
|
+
props: {
|
|
1837
|
+
items: {
|
|
1838
|
+
type: "slot",
|
|
1839
|
+
defaultValue: [
|
|
1840
|
+
{
|
|
1841
|
+
type: "component",
|
|
1842
|
+
name: listBoxItemMeta.name,
|
|
1843
|
+
props: {
|
|
1844
|
+
id: "section-1-1",
|
|
1845
|
+
textValue: "Section1-Item 1",
|
|
1846
|
+
children: [
|
|
1847
|
+
makeDefaultListBoxItemChildren(
|
|
1848
|
+
"Item 1",
|
|
1849
|
+
"Add dynamic values to make it more interesting"
|
|
1850
|
+
)
|
|
1851
|
+
]
|
|
1852
|
+
}
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
type: "component",
|
|
1856
|
+
name: listBoxItemMeta.name,
|
|
1857
|
+
props: {
|
|
1858
|
+
id: "section-1-2",
|
|
1859
|
+
textValue: "Section1-Item 2",
|
|
1860
|
+
children: [
|
|
1861
|
+
makeDefaultListBoxItemChildren(
|
|
1862
|
+
"Item 2",
|
|
1863
|
+
"Add dynamic values to make it more interesting"
|
|
1864
|
+
)
|
|
1865
|
+
]
|
|
1866
|
+
}
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
type: "component",
|
|
1870
|
+
name: listBoxItemMeta.name,
|
|
1871
|
+
props: {
|
|
1872
|
+
id: "section-1-3",
|
|
1873
|
+
textValue: "Section1-Item 3",
|
|
1874
|
+
children: [
|
|
1875
|
+
makeDefaultListBoxItemChildren(
|
|
1876
|
+
"Item 3",
|
|
1877
|
+
"Add dynamic values to make it more interesting"
|
|
1878
|
+
)
|
|
1879
|
+
]
|
|
1880
|
+
}
|
|
1875
1881
|
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
));
|
|
1879
|
-
} else {
|
|
1880
|
-
return /* @__PURE__ */ React__default.default.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
1882
|
+
]
|
|
1883
|
+
}
|
|
1881
1884
|
}
|
|
1882
1885
|
});
|
|
1883
|
-
}
|
|
1884
|
-
const LIST_BOX_COMPONENT_NAME = makeComponentName("listbox");
|
|
1885
|
-
function registerListBox(loader, overrides) {
|
|
1886
|
-
const listBoxItemMeta = registerListBoxItem(loader, {
|
|
1887
|
-
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1888
|
-
});
|
|
1889
|
-
const sectionMeta = registerSection(loader, {
|
|
1890
|
-
parentComponentName: LIST_BOX_COMPONENT_NAME
|
|
1891
|
-
});
|
|
1892
1886
|
registerComponentHelper(
|
|
1893
1887
|
loader,
|
|
1894
1888
|
BaseListBox,
|
|
@@ -1904,38 +1898,97 @@ function registerListBox(loader, overrides) {
|
|
|
1904
1898
|
borderColor: "black"
|
|
1905
1899
|
},
|
|
1906
1900
|
props: {
|
|
1907
|
-
|
|
1908
|
-
displayName: "Items",
|
|
1909
|
-
hidden: hasParent
|
|
1910
|
-
}),
|
|
1911
|
-
renderItem: {
|
|
1901
|
+
children: {
|
|
1912
1902
|
type: "slot",
|
|
1913
|
-
displayName: "
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1903
|
+
displayName: "List Items",
|
|
1904
|
+
allowedComponents: [listBoxItemMeta.name, sectionMeta.name],
|
|
1905
|
+
allowRootWrapper: true,
|
|
1906
|
+
defaultValue: [
|
|
1907
|
+
{
|
|
1908
|
+
type: "component",
|
|
1909
|
+
name: listBoxItemMeta.name,
|
|
1910
|
+
props: {
|
|
1911
|
+
id: "1",
|
|
1912
|
+
textValue: "Item 1",
|
|
1913
|
+
children: [
|
|
1914
|
+
makeDefaultListBoxItemChildren(
|
|
1915
|
+
"Item 1",
|
|
1916
|
+
"Add dynamic values to make it more interesting"
|
|
1917
|
+
)
|
|
1918
|
+
]
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
type: "component",
|
|
1923
|
+
name: listBoxItemMeta.name,
|
|
1924
|
+
props: {
|
|
1925
|
+
id: "2",
|
|
1926
|
+
textValue: "Item 2",
|
|
1927
|
+
children: [
|
|
1928
|
+
makeDefaultListBoxItemChildren(
|
|
1929
|
+
"Item 2",
|
|
1930
|
+
"Add dynamic values to make it more interesting"
|
|
1931
|
+
)
|
|
1932
|
+
]
|
|
1933
|
+
}
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
type: "component",
|
|
1937
|
+
name: listBoxItemMeta.name,
|
|
1938
|
+
props: {
|
|
1939
|
+
id: "3",
|
|
1940
|
+
textValue: "Item 3",
|
|
1941
|
+
children: [
|
|
1942
|
+
makeDefaultListBoxItemChildren(
|
|
1943
|
+
"Item 3",
|
|
1944
|
+
"Add dynamic values to make it more interesting"
|
|
1945
|
+
)
|
|
1946
|
+
]
|
|
1947
|
+
}
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
type: "component",
|
|
1951
|
+
name: sectionMeta.name
|
|
1923
1952
|
}
|
|
1924
|
-
|
|
1953
|
+
]
|
|
1925
1954
|
},
|
|
1926
|
-
|
|
1927
|
-
type: "
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
defaultValue:
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1955
|
+
selectionMode: {
|
|
1956
|
+
type: "choice",
|
|
1957
|
+
description: "The selection mode of the listbox",
|
|
1958
|
+
options: ["none", "single"],
|
|
1959
|
+
defaultValue: "none",
|
|
1960
|
+
hidden: (_props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
1961
|
+
},
|
|
1962
|
+
selectedKeys: {
|
|
1963
|
+
type: "choice",
|
|
1964
|
+
description: "The selected keys of the listbox",
|
|
1965
|
+
editOnly: true,
|
|
1966
|
+
uncontrolledProp: "defaultSelectedKeys",
|
|
1967
|
+
displayName: "Initial selected key",
|
|
1968
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
1969
|
+
hidden: (props, ctx) => !(ctx == null ? void 0 : ctx.isStandalone) || props.selectionMode === "none",
|
|
1970
|
+
// We do not support multiple selections yet (Because React Aria select and combobox only support single selections).
|
|
1971
|
+
multiSelect: false
|
|
1972
|
+
},
|
|
1973
|
+
onSelectionChange: {
|
|
1974
|
+
type: "eventHandler",
|
|
1975
|
+
argTypes: [{ name: "itemIds", type: "object" }]
|
|
1937
1976
|
}
|
|
1938
|
-
}
|
|
1977
|
+
},
|
|
1978
|
+
states: {
|
|
1979
|
+
selectedKey: __spreadValues$g({
|
|
1980
|
+
type: "writable",
|
|
1981
|
+
valueProp: "selectedKeys",
|
|
1982
|
+
onChangeProp: "onSelectionChange",
|
|
1983
|
+
variableType: "text"
|
|
1984
|
+
}, listboxHelpers.states.selectedKey)
|
|
1985
|
+
},
|
|
1986
|
+
componentHelpers: {
|
|
1987
|
+
helpers: listboxHelpers,
|
|
1988
|
+
importName: "listboxHelpers",
|
|
1989
|
+
importPath: "@plasmicpkgs/react-aria/skinny/registerListBox"
|
|
1990
|
+
},
|
|
1991
|
+
trapsFocus: true
|
|
1939
1992
|
},
|
|
1940
1993
|
overrides
|
|
1941
1994
|
);
|
|
@@ -1957,7 +2010,7 @@ var __spreadValues$f = (a, b) => {
|
|
|
1957
2010
|
}
|
|
1958
2011
|
return a;
|
|
1959
2012
|
};
|
|
1960
|
-
var __objRest$
|
|
2013
|
+
var __objRest$e = (source, exclude) => {
|
|
1961
2014
|
var target = {};
|
|
1962
2015
|
for (var prop in source)
|
|
1963
2016
|
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
@@ -1970,7 +2023,7 @@ var __objRest$d = (source, exclude) => {
|
|
|
1970
2023
|
return target;
|
|
1971
2024
|
};
|
|
1972
2025
|
function BasePopover(props) {
|
|
1973
|
-
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$
|
|
2026
|
+
const _a = props, { resetClassName, setControlContextData } = _a, restProps = __objRest$e(_a, ["resetClassName", "setControlContextData"]);
|
|
1974
2027
|
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
1975
2028
|
const context = React__default.default.useContext(PlasmicPopoverContext);
|
|
1976
2029
|
const isInsideSelect = !!React__default.default.useContext(reactAriaComponents.SelectContext);
|
|
@@ -2003,7 +2056,6 @@ function BasePopover(props) {
|
|
|
2003
2056
|
const POPOVER_COMPONENT_NAME = makeComponentName("popover");
|
|
2004
2057
|
const POPOVER_ARROW_IMG = {
|
|
2005
2058
|
type: "img",
|
|
2006
|
-
// TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
|
|
2007
2059
|
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
2008
2060
|
styles: {
|
|
2009
2061
|
position: "absolute",
|
|
@@ -2067,7 +2119,7 @@ function registerPopover(loader, overrides) {
|
|
|
2067
2119
|
type: "number",
|
|
2068
2120
|
displayName: "Offset",
|
|
2069
2121
|
description: "Additional offset applied vertically between the popover and its trigger",
|
|
2070
|
-
defaultValueHint:
|
|
2122
|
+
defaultValueHint: 8
|
|
2071
2123
|
},
|
|
2072
2124
|
shouldFlip: {
|
|
2073
2125
|
type: "boolean",
|
|
@@ -2101,8 +2153,8 @@ function registerPopover(loader, overrides) {
|
|
|
2101
2153
|
}
|
|
2102
2154
|
|
|
2103
2155
|
var __defProp$e = Object.defineProperty;
|
|
2104
|
-
var __defProps$
|
|
2105
|
-
var __getOwnPropDescs$
|
|
2156
|
+
var __defProps$8 = Object.defineProperties;
|
|
2157
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
2106
2158
|
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
2107
2159
|
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
2108
2160
|
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
@@ -2118,226 +2170,77 @@ var __spreadValues$e = (a, b) => {
|
|
|
2118
2170
|
}
|
|
2119
2171
|
return a;
|
|
2120
2172
|
};
|
|
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;
|
|
2173
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
2174
|
+
var __objRest$d = (source, exclude) => {
|
|
2175
|
+
var target = {};
|
|
2176
|
+
for (var prop in source)
|
|
2177
|
+
if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2178
|
+
target[prop] = source[prop];
|
|
2179
|
+
if (source != null && __getOwnPropSymbols$e)
|
|
2180
|
+
for (var prop of __getOwnPropSymbols$e(source)) {
|
|
2181
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
|
|
2182
|
+
target[prop] = source[prop];
|
|
2149
2183
|
}
|
|
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
|
-
}
|
|
2184
|
+
return target;
|
|
2185
|
+
};
|
|
2186
|
+
const COMBOBOX_NAME = makeComponentName("combobox");
|
|
2187
|
+
function BaseComboBox(props) {
|
|
2188
|
+
const _a = props, { children, setControlContextData, isOpen } = _a, rest = __objRest$d(_a, ["children", "setControlContextData", "isOpen"]);
|
|
2189
|
+
const idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
|
|
2190
|
+
React.useEffect(() => {
|
|
2191
|
+
idManager.subscribe((ids) => {
|
|
2192
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
2193
|
+
itemIds: ids
|
|
2194
|
+
});
|
|
2195
|
+
});
|
|
2196
|
+
}, []);
|
|
2197
|
+
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(
|
|
2198
|
+
PlasmicListBoxContext.Provider,
|
|
2199
|
+
{
|
|
2200
|
+
value: {
|
|
2201
|
+
idManager
|
|
2208
2202
|
}
|
|
2209
2203
|
},
|
|
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;
|
|
2204
|
+
children
|
|
2205
|
+
)));
|
|
2293
2206
|
}
|
|
2294
2207
|
function registerComboBox(loader) {
|
|
2295
|
-
const rootName = makeComponentName("combobox");
|
|
2296
2208
|
registerComponentHelper(loader, BaseComboBox, {
|
|
2297
|
-
name:
|
|
2209
|
+
name: COMBOBOX_NAME,
|
|
2298
2210
|
displayName: "Aria ComboBox",
|
|
2299
2211
|
importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
|
|
2300
2212
|
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",
|
|
2213
|
+
props: __spreadProps$8(__spreadValues$e({}, getCommonProps("ComboBox", [
|
|
2214
|
+
"name",
|
|
2215
|
+
"aria-label",
|
|
2216
|
+
"placeholder",
|
|
2217
|
+
"isDisabled"
|
|
2218
|
+
])), {
|
|
2219
|
+
selectedKey: {
|
|
2320
2220
|
type: "choice",
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2221
|
+
description: "The selected keys of the listbox",
|
|
2222
|
+
editOnly: true,
|
|
2223
|
+
uncontrolledProp: "defaultSelectedKey",
|
|
2224
|
+
displayName: "Initial selected key",
|
|
2225
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
2226
|
+
// React Aria ComboBox do not support multiple comboBoxions yet
|
|
2227
|
+
multiSelect: false
|
|
2328
2228
|
},
|
|
2329
|
-
|
|
2229
|
+
isOpen: {
|
|
2330
2230
|
type: "boolean",
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
hidden: (
|
|
2334
|
-
|
|
2231
|
+
defaultValue: false,
|
|
2232
|
+
// 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.
|
|
2233
|
+
hidden: () => true
|
|
2234
|
+
},
|
|
2235
|
+
onSelectionChange: {
|
|
2236
|
+
type: "eventHandler",
|
|
2237
|
+
argTypes: [{ name: "selectedKey", type: "string" }]
|
|
2335
2238
|
},
|
|
2336
2239
|
onOpenChange: {
|
|
2337
2240
|
type: "eventHandler",
|
|
2338
2241
|
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2339
2242
|
},
|
|
2340
|
-
|
|
2243
|
+
children: {
|
|
2341
2244
|
type: "slot",
|
|
2342
2245
|
defaultValue: [
|
|
2343
2246
|
{
|
|
@@ -2361,45 +2264,24 @@ function registerComboBox(loader) {
|
|
|
2361
2264
|
},
|
|
2362
2265
|
{
|
|
2363
2266
|
type: "hbox",
|
|
2364
|
-
styles: {
|
|
2365
|
-
width: "stretch",
|
|
2366
|
-
borderWidth: "1px",
|
|
2367
|
-
borderStyle: "solid",
|
|
2368
|
-
borderColor: "black",
|
|
2369
|
-
padding: 0,
|
|
2370
|
-
position: "relative"
|
|
2371
|
-
},
|
|
2372
2267
|
children: [
|
|
2373
2268
|
{
|
|
2374
2269
|
type: "component",
|
|
2375
2270
|
name: INPUT_COMPONENT_NAME,
|
|
2376
2271
|
styles: {
|
|
2377
|
-
|
|
2378
|
-
width: "100%",
|
|
2379
|
-
padding: "2px 30px 2px 10px"
|
|
2272
|
+
width: "100%"
|
|
2380
2273
|
}
|
|
2381
2274
|
},
|
|
2382
2275
|
{
|
|
2383
2276
|
type: "component",
|
|
2384
2277
|
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
2278
|
props: {
|
|
2397
2279
|
children: {
|
|
2398
2280
|
type: "img",
|
|
2281
|
+
// TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/
|
|
2399
2282
|
src: "https://static1.plasmic.app/arrow-up.svg",
|
|
2400
2283
|
styles: {
|
|
2401
|
-
|
|
2402
|
-
width: "20px",
|
|
2284
|
+
width: "15px",
|
|
2403
2285
|
transform: "rotate(180deg)"
|
|
2404
2286
|
}
|
|
2405
2287
|
}
|
|
@@ -2412,15 +2294,18 @@ function registerComboBox(loader) {
|
|
|
2412
2294
|
name: POPOVER_COMPONENT_NAME,
|
|
2413
2295
|
styles: {
|
|
2414
2296
|
backgroundColor: "white",
|
|
2415
|
-
width: "300px",
|
|
2416
2297
|
padding: "10px",
|
|
2417
2298
|
overflow: "scroll"
|
|
2418
2299
|
},
|
|
2419
2300
|
props: {
|
|
2301
|
+
offset: 0,
|
|
2420
2302
|
children: [
|
|
2421
2303
|
{
|
|
2422
2304
|
type: "component",
|
|
2423
2305
|
name: LIST_BOX_COMPONENT_NAME,
|
|
2306
|
+
props: {
|
|
2307
|
+
selectionMode: "single"
|
|
2308
|
+
},
|
|
2424
2309
|
styles: {
|
|
2425
2310
|
borderWidth: 0,
|
|
2426
2311
|
width: "stretch"
|
|
@@ -2432,29 +2317,18 @@ function registerComboBox(loader) {
|
|
|
2432
2317
|
]
|
|
2433
2318
|
}
|
|
2434
2319
|
]
|
|
2435
|
-
},
|
|
2436
|
-
previewOpen: {
|
|
2437
|
-
type: "boolean",
|
|
2438
|
-
displayName: "Preview opened?",
|
|
2439
|
-
description: "Preview opened state while designing in Plasmic editor",
|
|
2440
|
-
editOnly: true
|
|
2441
2320
|
}
|
|
2442
|
-
},
|
|
2321
|
+
}),
|
|
2443
2322
|
states: {
|
|
2444
|
-
|
|
2445
|
-
type: "writable",
|
|
2446
|
-
valueProp: "value",
|
|
2447
|
-
onChangeProp: "onChange",
|
|
2448
|
-
variableType: "text"
|
|
2449
|
-
},
|
|
2450
|
-
filterValue: {
|
|
2323
|
+
selectedKey: {
|
|
2451
2324
|
type: "writable",
|
|
2452
|
-
valueProp: "
|
|
2453
|
-
onChangeProp: "
|
|
2325
|
+
valueProp: "selectedKey",
|
|
2326
|
+
onChangeProp: "onSelectionChange",
|
|
2454
2327
|
variableType: "text"
|
|
2455
2328
|
},
|
|
2456
2329
|
isOpen: {
|
|
2457
|
-
type: "
|
|
2330
|
+
type: "writable",
|
|
2331
|
+
valueProp: "isOpen",
|
|
2458
2332
|
onChangeProp: "onOpenChange",
|
|
2459
2333
|
variableType: "boolean"
|
|
2460
2334
|
}
|
|
@@ -2463,8 +2337,8 @@ function registerComboBox(loader) {
|
|
|
2463
2337
|
}
|
|
2464
2338
|
|
|
2465
2339
|
var __defProp$d = Object.defineProperty;
|
|
2466
|
-
var __defProps$
|
|
2467
|
-
var __getOwnPropDescs$
|
|
2340
|
+
var __defProps$7 = Object.defineProperties;
|
|
2341
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
2468
2342
|
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
2469
2343
|
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
2470
2344
|
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
@@ -2480,7 +2354,7 @@ var __spreadValues$d = (a, b) => {
|
|
|
2480
2354
|
}
|
|
2481
2355
|
return a;
|
|
2482
2356
|
};
|
|
2483
|
-
var __spreadProps$
|
|
2357
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
2484
2358
|
var __objRest$c = (source, exclude) => {
|
|
2485
2359
|
var target = {};
|
|
2486
2360
|
for (var prop in source)
|
|
@@ -2501,6 +2375,7 @@ const BaseModal = React.forwardRef(
|
|
|
2501
2375
|
modalOverlayClass,
|
|
2502
2376
|
className,
|
|
2503
2377
|
isOpen,
|
|
2378
|
+
resetClassName,
|
|
2504
2379
|
setControlContextData
|
|
2505
2380
|
} = _a, rest = __objRest$c(_a, [
|
|
2506
2381
|
"children",
|
|
@@ -2508,6 +2383,7 @@ const BaseModal = React.forwardRef(
|
|
|
2508
2383
|
"modalOverlayClass",
|
|
2509
2384
|
"className",
|
|
2510
2385
|
"isOpen",
|
|
2386
|
+
"resetClassName",
|
|
2511
2387
|
"setControlContextData"
|
|
2512
2388
|
]);
|
|
2513
2389
|
const contextProps = React__default.default.useContext(PlasmicDialogTriggerContext);
|
|
@@ -2530,7 +2406,13 @@ const BaseModal = React.forwardRef(
|
|
|
2530
2406
|
}));
|
|
2531
2407
|
const isCanvas = host.usePlasmicCanvasContext();
|
|
2532
2408
|
const body = /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, heading && /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Heading, { slot: "title" }, heading), children);
|
|
2533
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
2409
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2410
|
+
reactAriaComponents.ModalOverlay,
|
|
2411
|
+
__spreadProps$7(__spreadValues$d({}, mergedProps), {
|
|
2412
|
+
className: `${resetClassName} ${modalOverlayClass}`
|
|
2413
|
+
}),
|
|
2414
|
+
/* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className }, isCanvas ? body : /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Dialog, null, body))
|
|
2415
|
+
);
|
|
2534
2416
|
}
|
|
2535
2417
|
);
|
|
2536
2418
|
const MODAL_COMPONENT_NAME = makeComponentName("modal");
|
|
@@ -2634,6 +2516,9 @@ function registerModal(loader, overrides) {
|
|
|
2634
2516
|
onOpenChange: {
|
|
2635
2517
|
type: "eventHandler",
|
|
2636
2518
|
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
2519
|
+
},
|
|
2520
|
+
resetClassName: {
|
|
2521
|
+
type: "themeResetClass"
|
|
2637
2522
|
}
|
|
2638
2523
|
},
|
|
2639
2524
|
states: {
|
|
@@ -2822,8 +2707,8 @@ function registerForm(loader, overrides) {
|
|
|
2822
2707
|
}
|
|
2823
2708
|
|
|
2824
2709
|
var __defProp$a = Object.defineProperty;
|
|
2825
|
-
var __defProps$
|
|
2826
|
-
var __getOwnPropDescs$
|
|
2710
|
+
var __defProps$6 = Object.defineProperties;
|
|
2711
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
2827
2712
|
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
2828
2713
|
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
2829
2714
|
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
@@ -2839,7 +2724,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
2839
2724
|
}
|
|
2840
2725
|
return a;
|
|
2841
2726
|
};
|
|
2842
|
-
var __spreadProps$
|
|
2727
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
2843
2728
|
var __objRest$9 = (source, exclude) => {
|
|
2844
2729
|
var target = {};
|
|
2845
2730
|
for (var prop in source)
|
|
@@ -2940,7 +2825,7 @@ function registerRadio(loader, overrides) {
|
|
|
2940
2825
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadio",
|
|
2941
2826
|
importName: "BaseRadio",
|
|
2942
2827
|
interactionVariants: interactionVariants$8,
|
|
2943
|
-
props: __spreadProps$
|
|
2828
|
+
props: __spreadProps$6(__spreadValues$a({}, getCommonProps("radio", [
|
|
2944
2829
|
"isDisabled",
|
|
2945
2830
|
"autoFocus",
|
|
2946
2831
|
"aria-label"
|
|
@@ -2962,8 +2847,8 @@ function registerRadio(loader, overrides) {
|
|
|
2962
2847
|
}
|
|
2963
2848
|
|
|
2964
2849
|
var __defProp$9 = Object.defineProperty;
|
|
2965
|
-
var __defProps$
|
|
2966
|
-
var __getOwnPropDescs$
|
|
2850
|
+
var __defProps$5 = Object.defineProperties;
|
|
2851
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
2967
2852
|
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
2968
2853
|
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
2969
2854
|
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
@@ -2979,7 +2864,7 @@ var __spreadValues$9 = (a, b) => {
|
|
|
2979
2864
|
}
|
|
2980
2865
|
return a;
|
|
2981
2866
|
};
|
|
2982
|
-
var __spreadProps$
|
|
2867
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
2983
2868
|
var __objRest$8 = (source, exclude) => {
|
|
2984
2869
|
var target = {};
|
|
2985
2870
|
for (var prop in source)
|
|
@@ -3028,7 +2913,7 @@ function registerRadioGroup(loader, overrides) {
|
|
|
3028
2913
|
importPath: "@plasmicpkgs/react-aria/skinny/registerRadioGroup",
|
|
3029
2914
|
importName: "BaseRadioGroup",
|
|
3030
2915
|
interactionVariants: interactionVariants$7,
|
|
3031
|
-
props: __spreadProps$
|
|
2916
|
+
props: __spreadProps$5(__spreadValues$9({}, getCommonProps("radio group", [
|
|
3032
2917
|
"name",
|
|
3033
2918
|
"isDisabled",
|
|
3034
2919
|
"isReadOnly",
|
|
@@ -3135,6 +3020,8 @@ function registerRadioGroup(loader, overrides) {
|
|
|
3135
3020
|
}
|
|
3136
3021
|
|
|
3137
3022
|
var __defProp$8 = Object.defineProperty;
|
|
3023
|
+
var __defProps$4 = Object.defineProperties;
|
|
3024
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
3138
3025
|
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
3139
3026
|
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
3140
3027
|
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
@@ -3150,6 +3037,7 @@ var __spreadValues$8 = (a, b) => {
|
|
|
3150
3037
|
}
|
|
3151
3038
|
return a;
|
|
3152
3039
|
};
|
|
3040
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
3153
3041
|
const BaseSelectValue = (props) => {
|
|
3154
3042
|
const { children, customize } = props;
|
|
3155
3043
|
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))));
|
|
@@ -3157,29 +3045,36 @@ const BaseSelectValue = (props) => {
|
|
|
3157
3045
|
const SELECT_NAME = makeComponentName("select");
|
|
3158
3046
|
function BaseSelect(props) {
|
|
3159
3047
|
const {
|
|
3160
|
-
|
|
3161
|
-
|
|
3048
|
+
selectedKey,
|
|
3049
|
+
onSelectionChange,
|
|
3162
3050
|
placeholder,
|
|
3163
3051
|
previewOpen,
|
|
3164
3052
|
onOpenChange,
|
|
3165
3053
|
isDisabled,
|
|
3166
3054
|
className,
|
|
3167
3055
|
style,
|
|
3168
|
-
|
|
3056
|
+
children,
|
|
3169
3057
|
name,
|
|
3170
3058
|
isOpen,
|
|
3059
|
+
setControlContextData,
|
|
3171
3060
|
"aria-label": ariaLabel
|
|
3172
3061
|
} = props;
|
|
3173
|
-
const { options } = useStrictOptions(props);
|
|
3174
3062
|
const isEditMode = !!host.usePlasmicCanvasContext();
|
|
3175
3063
|
const openProp = isEditMode && previewOpen ? true : isOpen;
|
|
3176
|
-
|
|
3064
|
+
let idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
|
|
3065
|
+
React.useEffect(() => {
|
|
3066
|
+
idManager.subscribe((ids) => {
|
|
3067
|
+
setControlContextData == null ? void 0 : setControlContextData({
|
|
3068
|
+
itemIds: ids
|
|
3069
|
+
});
|
|
3070
|
+
});
|
|
3071
|
+
}, []);
|
|
3177
3072
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
3178
3073
|
reactAriaComponents.Select,
|
|
3179
3074
|
__spreadValues$8({
|
|
3180
3075
|
placeholder,
|
|
3181
|
-
selectedKey
|
|
3182
|
-
onSelectionChange
|
|
3076
|
+
selectedKey,
|
|
3077
|
+
onSelectionChange,
|
|
3183
3078
|
onOpenChange,
|
|
3184
3079
|
isDisabled,
|
|
3185
3080
|
className,
|
|
@@ -3192,11 +3087,10 @@ function BaseSelect(props) {
|
|
|
3192
3087
|
PlasmicListBoxContext.Provider,
|
|
3193
3088
|
{
|
|
3194
3089
|
value: {
|
|
3195
|
-
|
|
3196
|
-
disabledKeys
|
|
3090
|
+
idManager
|
|
3197
3091
|
}
|
|
3198
3092
|
},
|
|
3199
|
-
|
|
3093
|
+
children
|
|
3200
3094
|
))
|
|
3201
3095
|
);
|
|
3202
3096
|
}
|
|
@@ -3238,27 +3132,44 @@ function registerSelect(loader) {
|
|
|
3238
3132
|
displayName: "Aria Select",
|
|
3239
3133
|
importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
|
|
3240
3134
|
importName: "BaseSelect",
|
|
3241
|
-
props: {
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3135
|
+
props: __spreadProps$4(__spreadValues$8({}, getCommonProps("Select", [
|
|
3136
|
+
"name",
|
|
3137
|
+
"aria-label",
|
|
3138
|
+
"placeholder",
|
|
3139
|
+
"isDisabled",
|
|
3140
|
+
"autoFocus"
|
|
3141
|
+
])), {
|
|
3142
|
+
selectedKey: {
|
|
3143
|
+
type: "choice",
|
|
3144
|
+
description: "The selected keys of the listbox",
|
|
3145
|
+
editOnly: true,
|
|
3146
|
+
uncontrolledProp: "defaultSelectedKey",
|
|
3147
|
+
displayName: "Initial selected key",
|
|
3148
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
3149
|
+
// React Aria Select do not support multiple selections yet
|
|
3150
|
+
multiSelect: false
|
|
3248
3151
|
},
|
|
3249
|
-
|
|
3250
|
-
onChange: {
|
|
3152
|
+
onSelectionChange: {
|
|
3251
3153
|
type: "eventHandler",
|
|
3252
3154
|
argTypes: [{ name: "value", type: "string" }]
|
|
3253
3155
|
},
|
|
3156
|
+
disabledKeys: {
|
|
3157
|
+
type: "choice",
|
|
3158
|
+
description: "The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.",
|
|
3159
|
+
options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
|
|
3160
|
+
multiSelect: true,
|
|
3161
|
+
advanced: true
|
|
3162
|
+
},
|
|
3254
3163
|
previewOpen: {
|
|
3255
3164
|
type: "boolean",
|
|
3256
3165
|
displayName: "Preview opened?",
|
|
3257
3166
|
description: "Preview opened state while designing in Plasmic editor",
|
|
3258
|
-
editOnly: true
|
|
3167
|
+
editOnly: true,
|
|
3168
|
+
defaultValue: false
|
|
3259
3169
|
},
|
|
3260
3170
|
isOpen: {
|
|
3261
3171
|
type: "boolean",
|
|
3172
|
+
defaultValue: false,
|
|
3262
3173
|
// 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.
|
|
3263
3174
|
hidden: () => true
|
|
3264
3175
|
},
|
|
@@ -3266,40 +3177,7 @@ function registerSelect(loader) {
|
|
|
3266
3177
|
type: "eventHandler",
|
|
3267
3178
|
argTypes: [{ name: "isOpen", type: "boolean" }]
|
|
3268
3179
|
},
|
|
3269
|
-
|
|
3270
|
-
// type: "string",
|
|
3271
|
-
// displayName: "Field key for an option's value",
|
|
3272
|
-
// hidden: (ps) =>
|
|
3273
|
-
// !ps.options ||
|
|
3274
|
-
// !ps.options[0] ||
|
|
3275
|
-
// typeof ps.options[0] === "string" ||
|
|
3276
|
-
// "value" in ps.options[0],
|
|
3277
|
-
// exprHint:
|
|
3278
|
-
// "Return a function that takes in an option object, and returns the key to use",
|
|
3279
|
-
// },
|
|
3280
|
-
// optionText: {
|
|
3281
|
-
// type: "string",
|
|
3282
|
-
// displayName: "Field key for an option's text 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 text value to use",
|
|
3290
|
-
// },
|
|
3291
|
-
// optionDisabled: {
|
|
3292
|
-
// type: "string",
|
|
3293
|
-
// displayName: "Field key for whether an option is disabled",
|
|
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 true if option should be disabled",
|
|
3301
|
-
// },
|
|
3302
|
-
structure: {
|
|
3180
|
+
children: {
|
|
3303
3181
|
type: "slot",
|
|
3304
3182
|
defaultValue: [
|
|
3305
3183
|
{
|
|
@@ -3367,6 +3245,9 @@ function registerSelect(loader) {
|
|
|
3367
3245
|
{
|
|
3368
3246
|
type: "component",
|
|
3369
3247
|
name: LIST_BOX_COMPONENT_NAME,
|
|
3248
|
+
props: {
|
|
3249
|
+
selectionMode: "single"
|
|
3250
|
+
},
|
|
3370
3251
|
styles: {
|
|
3371
3252
|
borderWidth: 0,
|
|
3372
3253
|
width: "stretch"
|
|
@@ -3378,31 +3259,13 @@ function registerSelect(loader) {
|
|
|
3378
3259
|
]
|
|
3379
3260
|
}
|
|
3380
3261
|
]
|
|
3381
|
-
},
|
|
3382
|
-
// renderOption: {
|
|
3383
|
-
// type: "slot",
|
|
3384
|
-
// displayName: "Custom render option",
|
|
3385
|
-
// renderPropParams: ["item"],
|
|
3386
|
-
// hidePlaceholder: true
|
|
3387
|
-
// },
|
|
3388
|
-
name: {
|
|
3389
|
-
type: "string",
|
|
3390
|
-
displayName: "Form field key",
|
|
3391
|
-
description: "Name of the input, when submitting in an HTML form",
|
|
3392
|
-
advanced: true
|
|
3393
|
-
},
|
|
3394
|
-
"aria-label": {
|
|
3395
|
-
type: "string",
|
|
3396
|
-
displayName: "ARIA label",
|
|
3397
|
-
description: "Label for this input, if no visible label is used",
|
|
3398
|
-
advanced: true
|
|
3399
3262
|
}
|
|
3400
|
-
},
|
|
3263
|
+
}),
|
|
3401
3264
|
states: {
|
|
3402
|
-
|
|
3265
|
+
selectedKey: {
|
|
3403
3266
|
type: "writable",
|
|
3404
|
-
valueProp: "
|
|
3405
|
-
onChangeProp: "
|
|
3267
|
+
valueProp: "selectedKey",
|
|
3268
|
+
onChangeProp: "onSelectionChange",
|
|
3406
3269
|
variableType: "text"
|
|
3407
3270
|
},
|
|
3408
3271
|
isOpen: {
|
|
@@ -3477,6 +3340,22 @@ function registerSliderOutput(loader, overrides) {
|
|
|
3477
3340
|
);
|
|
3478
3341
|
}
|
|
3479
3342
|
|
|
3343
|
+
class ErrorBoundary extends React.Component {
|
|
3344
|
+
constructor(props) {
|
|
3345
|
+
super(props);
|
|
3346
|
+
this.state = { hasError: false };
|
|
3347
|
+
}
|
|
3348
|
+
static getDerivedStateFromError(_) {
|
|
3349
|
+
return { hasError: true };
|
|
3350
|
+
}
|
|
3351
|
+
render() {
|
|
3352
|
+
if (this.state.hasError) {
|
|
3353
|
+
return this.props.fallback;
|
|
3354
|
+
}
|
|
3355
|
+
return this.props.children;
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3480
3359
|
var __defProp$6 = Object.defineProperty;
|
|
3481
3360
|
var __defProps$3 = Object.defineProperties;
|
|
3482
3361
|
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|