1.1.27 • Published 11 days ago

@rainbow-d9/thai-plan-selection v1.1.27

Weekly downloads
-
License
MIT
Repository
github
Last release
11 days ago

Static Badge

License GitHub Release GitHub Release Date GitHub last commit (by committer)

npm (scoped) npm

Depends Depends Depends

Module Formats

d9-thai-plan-selection

Plan selection for Thai Cloud.

Attribute NameTypeDescription
columnsnumbermax plans count in one page, default is 3. set tp <=0 value to represent no limit, which means show horizontal scrollbar and column width and line header width are in pixels (number).
columnWidthnumber, textplan column width
lineHeaderWidthnumber, textfirst column width, default use columns and columnWidth to compute
maxHeightnumber, textmax body height, plan header and footer are not included
defsPlanDefs, PlanDefsFuncplan candidate definitions
valuesInitPlanValuesInitFuncinitialize plan values, invoked after defs first initialized
valuesClearPlanValuesClearFuncclear plan values, invoked after defs reloaded
currencySymbolstring, ReactNodecurrency symbol
premiumDescriptionstring, ReactNodepremium description
buyTextstring, ReactNodebuy button text
buyButtonClickbuy button click handler
planTitlePlanTitleFuncplan header title
planSubTitlePlanSubTitleFuncplan header subtitle
elementTitlePlanElementTitleFuncplan element title, level starts from 0
elementFixedValuePlanElementFixedValueFuncplan element fixed value
elementOptionsValuePlanElementOptionsValueFuncplan element options value
elementNumberValuePlanElementNumberValueFuncplan element number value
elementNumberValueValidatorPlanElementNumberValueValidatorFuncplan element number value validator
planOperatorsPlanOperatorsFuncplan operators
calculationDelaynumberdefault 1s
calculatePlanCalculateFuncdo calculation

Force Reload Plan Definitions

Sometimes, the definition of the available options for a plan needs to be reloaded. In such cases, you can force a plan reload by sending a custom event to the component. It is important to note that reloading the plan definition may result in a mismatch between the memory data associated with the current plan and the newly loaded plan. In this scenario, you can perform appropriate cleanup by using the valuesClear method. If the valuesClear parameter is not specified, the component will not operate on the model after reloading the plan definition. Here is an example of sending an event:

import {useSimpleCustomGlobalEvent} from '@rainbow-d9/n2';

// useSimpleCustomGlobalEvent is same as useCustomGlobalEvent, but it is a simple version, which will build parameter key inside.
const fireCustomEvent = useSimpleCustomGlobalEvent();
// marker is required, it is used to identify the plan selection widget even there is only one exists.
// should be same as the marker declared in PlanSelectionDef.
const marker = 'plan-unique-marker';
// model is based on where to fire this event, not model of plan selection.
fireCustomEvent(PlanSelectionGlobalEventPrefix.RELOAD_DEFS, marker, {root, model});

A sample

- PlanSelect::::plans
	- defs: @ext.defs
	- currencySymbol: ฿
	- premiumDescription: After Tax
	- buy: @ext.buy
	- calculationDelay: 3
	- calculate: @ext.calculate
1.1.27

11 days ago

1.1.26

15 days ago

1.1.25

20 days ago

1.1.24

21 days ago

1.1.23

25 days ago

1.1.22

25 days ago

1.1.21

25 days ago

1.1.20

26 days ago

1.1.19

27 days ago

1.1.18

1 month ago

1.1.17

1 month ago

1.1.16

1 month ago

1.1.15

1 month ago

1.1.12

1 month ago

1.1.14

1 month ago

1.1.13

1 month ago

1.1.11

1 month ago

1.1.9

1 month ago

1.1.10

1 month ago

1.1.10-alpha.1

1 month ago

1.1.10-alpha.2

1 month ago

1.1.8

2 months ago

1.1.7

2 months ago

1.1.6

2 months ago

1.1.5

2 months ago

1.1.4

2 months ago

1.1.3

2 months ago

1.1.2

2 months ago

1.1.1

2 months ago

1.1.0

2 months ago

1.0.58

2 months ago

1.0.57

2 months ago

1.0.56-alpha.1

3 months ago

1.0.56

3 months ago

1.0.55

3 months ago

1.0.54

3 months ago

1.0.53

3 months ago

1.0.52

3 months ago

1.0.51

3 months ago

1.0.50

4 months ago

1.0.49

4 months ago

1.0.48

4 months ago

1.0.47

4 months ago

1.0.46

4 months ago

1.0.44

4 months ago

1.0.45

4 months ago

1.0.43

4 months ago

1.0.39

4 months ago

1.0.40

4 months ago

1.0.42

4 months ago

1.0.41

4 months ago

1.0.38

4 months ago

1.0.37

4 months ago

1.0.36

4 months ago

1.0.35

4 months ago